@@ -201,7 +201,7 @@ static int uart_emul_config_get(const struct device *dev, struct uart_config *cf
201
201
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
202
202
static int uart_emul_fifo_fill (const struct device * dev , const uint8_t * tx_data , int size )
203
203
{
204
- int ret ;
204
+ int ret = 0 ;
205
205
struct uart_emul_data * data = dev -> data ;
206
206
const struct uart_emul_config * config = dev -> config ;
207
207
uint32_t put_size = MIN (config -> latch_buffer_size , size );
@@ -223,7 +223,7 @@ static int uart_emul_fifo_read(const struct device *dev, uint8_t *rx_data, int s
223
223
{
224
224
struct uart_emul_data * data = dev -> data ;
225
225
const struct uart_emul_config * config = dev -> config ;
226
- uint32_t bytes_to_read ;
226
+ uint32_t bytes_to_read = 0 ;
227
227
228
228
K_SPINLOCK (& data -> rx_lock ) {
229
229
bytes_to_read = MIN (config -> latch_buffer_size , ring_buf_size_get (data -> rx_rb ));
@@ -312,7 +312,7 @@ static int uart_emul_irq_is_pending(const struct device *dev)
312
312
313
313
static void uart_emul_irq_tx_enable (const struct device * dev )
314
314
{
315
- bool submit_irq_work ;
315
+ bool submit_irq_work = false ;
316
316
struct uart_emul_data * const data = dev -> data ;
317
317
318
318
K_SPINLOCK (& data -> tx_lock ) {
@@ -327,7 +327,7 @@ static void uart_emul_irq_tx_enable(const struct device *dev)
327
327
328
328
static void uart_emul_irq_rx_enable (const struct device * dev )
329
329
{
330
- bool submit_irq_work ;
330
+ bool submit_irq_work = false ;
331
331
struct uart_emul_data * const data = dev -> data ;
332
332
333
333
K_SPINLOCK (& data -> rx_lock ) {
@@ -919,10 +919,10 @@ void uart_emul_callback_tx_data_ready_set(const struct device *dev,
919
919
uint32_t uart_emul_put_rx_data (const struct device * dev , const uint8_t * data , size_t size )
920
920
{
921
921
struct uart_emul_data * drv_data = dev -> data ;
922
- uint32_t count ;
923
- __unused bool empty ;
924
- __unused bool irq_en ;
925
- __unused bool rx_en ;
922
+ uint32_t count = 0 ;
923
+ __unused bool empty = false ;
924
+ __unused bool irq_en = false ;
925
+ __unused bool rx_en = false ;
926
926
927
927
K_SPINLOCK (& drv_data -> rx_lock ) {
928
928
count = ring_buf_put (drv_data -> rx_rb , data , size );
0 commit comments