From 585d954d0b8dcd1b3e70a201cb5e2edd50c3da93 Mon Sep 17 00:00:00 2001 From: Bartosz Wawrzynek Date: Thu, 22 Jan 2026 08:41:18 +0100 Subject: [PATCH] boards/sim: Fix watchdog callback drivers: Fix types and sx127x driver rx net/pkt: Fix type Small fixes. Signed-off-by: Bartosz --- boards/sim/sim/sim/src/sim_gpio.c | 3 +- drivers/video/isx019.c | 44 +++++++++++++------------- drivers/wireless/lpwan/sx127x/sx127x.c | 11 +++++-- net/pkt/pkt_recvmsg.c | 2 +- 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/boards/sim/sim/sim/src/sim_gpio.c b/boards/sim/sim/sim/src/sim_gpio.c index 44e5051bd6b..bb6fce820dd 100644 --- a/boards/sim/sim/sim/src/sim_gpio.c +++ b/boards/sim/sim/sim/src/sim_gpio.c @@ -131,7 +131,7 @@ static struct simgpint_dev_s g_gpint = * Private Functions ****************************************************************************/ -static int sim_interrupt(wdparm_t arg) +static void sim_interrupt(wdparm_t arg) { struct simgpint_dev_s *simgpint = (struct simgpint_dev_s *)arg; @@ -139,7 +139,6 @@ static int sim_interrupt(wdparm_t arg) gpioinfo("Interrupt! callback=%p\n", simgpint->callback); simgpint->callback(&simgpint->simgpio.gpio, simgpint->simgpio.id); - return OK; } static int gpin_read(struct gpio_dev_s *dev, bool *value) diff --git a/drivers/video/isx019.c b/drivers/video/isx019.c index c02ce3e8f7a..a531490e3c8 100644 --- a/drivers/video/isx019.c +++ b/drivers/video/isx019.c @@ -2593,18 +2593,18 @@ static int calc_spot_position_regval(uint16_t val, static int set_spot_position(FAR isx019_dev_t *priv, imgsensor_value_t val) { - uint8_t regval; - uint8_t reg_x; - uint8_t reg_y; - uint16_t w; - uint16_t h; - uint16_t clip_w; - uint16_t clip_h; - uint16_t offset_x; - uint16_t offset_y; + uint8_t regval = 0; + uint8_t reg_x = 0; + uint8_t reg_y = 0; + uint16_t w = 0; + uint16_t h = 0; + uint16_t clip_w = 0; + uint16_t clip_h = 0; + uint16_t offset_x = 0; + uint16_t offset_y = 0; uint16_t x = (uint16_t)(val.value32 >> 16); uint16_t y = (uint16_t)(val.value32 & 0xffff); - int split; + int split = 0; /* Spot position of ISX019 is divided into 9x7 sections. * - Horizontal direction is divided into 9 sections. @@ -3319,18 +3319,18 @@ static uint32_t restore_spot_position(uint16_t regval, static int get_spot_position(FAR isx019_dev_t *priv, FAR imgsensor_value_t *val) { - uint8_t regval; - uint8_t regx; - uint8_t regy; - uint16_t w; - uint16_t h; - uint32_t x; - uint32_t y; - uint16_t clip_w; - uint16_t clip_h; - uint16_t offset_x; - uint16_t offset_y; - int split; + uint8_t regval = 0; + uint8_t regx = 0; + uint8_t regy = 0; + uint16_t w = 0; + uint16_t h = 0; + uint32_t x = 0; + uint32_t y = 0; + uint16_t clip_w = 0; + uint16_t clip_h = 0; + uint16_t offset_x = 0; + uint16_t offset_y = 0; + int split = 0; isx019_i2c_read(priv, CAT_CATAE, SPOT_FRM_NUM, ®val, 1); diff --git a/drivers/wireless/lpwan/sx127x/sx127x.c b/drivers/wireless/lpwan/sx127x/sx127x.c index 8d4e1181bda..06126c09960 100644 --- a/drivers/wireless/lpwan/sx127x/sx127x.c +++ b/drivers/wireless/lpwan/sx127x/sx127x.c @@ -1286,7 +1286,8 @@ errout: * ****************************************************************************/ -#ifdef CONFIG_LPWAN_SX127X_RXSUPPORT +#if defined(CONFIG_LPWAN_SX127X_RXSUPPORT) && \ + CONFIG_LPWAN_SX127X_RX_TIMEOUT > 0 static void sx127x_rx_watchdog(FAR void *arg) { FAR struct sx127x_dev_s *dev = (FAR struct sx127x_dev_s *)arg; @@ -1320,7 +1321,7 @@ static void sx127x_rx_watchdog(FAR void *arg) sx127x_rx_watchdog, dev, MSEC2TICK(dev->rx_timeout)); } -#endif +#endif /* CONFIG_LPWAN_SX127X_RXSUPPORT && CONFIG_LPWAN_SX127X_RX_TIMEOUT > 0 */ /**************************************************************************** * Name: sx127x_lora_isr0_process @@ -1519,6 +1520,7 @@ static int sx127x_fskook_isr0_process(FAR struct sx127x_dev_s *dev) { /* Should we take care of RX timeout? */ +#if CONFIG_LPWAN_SX127X_RX_TIMEOUT > 0 if (dev->rx_timeout > 0) { /* Keep a track of last RX time to detect timeout */ @@ -1531,6 +1533,7 @@ static int sx127x_fskook_isr0_process(FAR struct sx127x_dev_s *dev) sx127x_rx_watchdog, dev, MSEC2TICK(dev->rx_timeout)); } +#endif if (dev->pfd) { @@ -4268,7 +4271,9 @@ static int sx127x_deinit(FAR struct sx127x_dev_s *dev) #ifdef CONFIG_LPWAN_SX127X_RXSUPPORT /* Cancel any running watchdog */ +# if CONFIG_LPWAN_SX127X_RX_TIMEOUT > 0 work_cancel(LPWORK, &dev->rx_watchdog); +# endif #endif /* Enter SLEEP mode */ @@ -4626,7 +4631,9 @@ static int sx127x_unregister(FAR struct sx127x_dev_s *dev) nxsem_destroy(&dev->tx_sem); #endif #ifdef CONFIG_LPWAN_SX127X_RXSUPPORT +# if CONFIG_LPWAN_SX127X_RX_TIMEOUT > 0 work_cancel(LPWORK, &dev->rx_watchdog); +# endif nxsem_destroy(&dev->rx_sem); nxmutex_destroy(&dev->rx_buffer_lock); #endif diff --git a/net/pkt/pkt_recvmsg.c b/net/pkt/pkt_recvmsg.c index efe48051c7e..4db6f2ffc23 100644 --- a/net/pkt/pkt_recvmsg.c +++ b/net/pkt/pkt_recvmsg.c @@ -154,7 +154,7 @@ static inline void pkt_add_recvlen(FAR struct pkt_recvfrom_s *pstate, static void pkt_recvfrom_newdata(FAR struct net_driver_s *dev, FAR struct pkt_recvfrom_s *pstate) { - unsigned int offset = 0; + int offset = 0; size_t recvlen; #ifdef CONFIG_NET_TIMESTAMP