From e9a5b48b6cc1481aa659746fc15f2f0308a06891 Mon Sep 17 00:00:00 2001 From: James Roy Date: Wed, 18 Dec 2024 10:03:48 +0800 Subject: [PATCH] drivers: gpio: Fix uninitialized variable in gpio_pca_series Fix uninitialized val variables scanned by Coverity. Signed-off-by: James Roy --- drivers/gpio/gpio_pca_series.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio_pca_series.c b/drivers/gpio/gpio_pca_series.c index bdea2dc56b2..7bfff83ce1e 100644 --- a/drivers/gpio/gpio_pca_series.c +++ b/drivers/gpio/gpio_pca_series.c @@ -898,7 +898,7 @@ static int gpio_pca_series_pin_configure(const struct device *dev, { const struct gpio_pca_series_config *cfg = dev->config; struct gpio_pca_series_data *data = dev->data; - uint32_t reg_value; + uint32_t reg_value = 0; int ret = 0; if ((flags & GPIO_INPUT) && (flags & GPIO_OUTPUT)) { @@ -1474,9 +1474,9 @@ static void gpio_pca_series_interrupt_handler_standard(const struct device *dev, { struct gpio_pca_series_data *data = dev->data; int ret = 0; - uint32_t input_old, int_rise, int_fall; - uint32_t input; - uint32_t transitioned_pins; + uint32_t input_old = 0, int_rise = 0, int_fall = 0; + uint32_t input = 0; + uint32_t transitioned_pins = 0; uint32_t int_status = 0; k_sem_take(&data->lock, K_FOREVER);