gpio: fix clang -Wpointer-bool-conversion warning
PATCH 1/1 gpio: fix clang -Wpointer-bool-conversion warning
Remove a check that incorrectly attempted to determine if the "name" field of a struct gpioline_info object was NULL. It relied on a pointer-to-bool conversion that didn't work as expected since the "name" field is an array, not a pointer. The address of an array always evaluates to true when converted to a boolean. In this case, there is no need for a NULL pointer check.
--- ell/gpio.c | 3 --- 1 file changed, 3 deletions(-)
ell/gpio.c +0 -3
@@ -189,9 +189,6 @@ LIB_EXPORT bool l_gpio_chip_find_line_offset(struct l_gpio_chip *chip,if (ioctl (chip->fd,GPIO_GET_LINEINFO_IOCTL , &info) <0 )return false; -if (!info.name) -continue ; -if (strcmp (info.name, line_label) !=0 )continue ;
Signature · 1 line
2.20.1
Denis Kenzior
AppliedHi Ossama,
Quoted 10 lines · Ossama Othman
Remove a check that incorrectly attempted to determine if the "name" field of a struct
gpioline_infoobject was NULL. It relied on a pointer-to-bool conversion that didn't work as expected since the "name" field is an array, not a pointer. The address of an array always evaluates to true when converted to a boolean. In this case, there is no need for a NULL pointer check.--- ell/gpio.c | 3 --- 1 file changed, 3 deletions(-)
Applied, thanks.
Regards,
-Denis