[U-Boot] [PATCH 2/3] drivers/gpio/pm8916_gpio.c: Make pid be uint32_t

Tom Rini trini at konsulko.com
Tue Apr 12 21:11:23 CEST 2016


If get_dev_addr fails it will return FDT_ADDR_T_NONE and:
>>>     "priv->pid == 4294967295U" is always false regardless of the values of its operands. This occurs as the logical operand of if.

Cc: Mateusz Kulikowski <mateusz.kulikowski at gmail.com>
Reported-by: Coverity (CID: 143913)
Signed-off-by: Tom Rini <trini at konsulko.com>
---
 drivers/gpio/pm8916_gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/pm8916_gpio.c b/drivers/gpio/pm8916_gpio.c
index 1abab7f..0b61975 100644
--- a/drivers/gpio/pm8916_gpio.c
+++ b/drivers/gpio/pm8916_gpio.c
@@ -50,7 +50,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define REG_EN_CTL_ENABLE      (1 << 7)
 
 struct pm8916_gpio_bank {
-	uint16_t pid; /* Peripheral ID on SPMI bus */
+	uint32_t pid; /* Peripheral ID on SPMI bus */
 };
 
 static int pm8916_gpio_set_direction(struct udevice *dev, unsigned offset,
-- 
1.9.1



More information about the U-Boot mailing list