Skip to contentSkip to conversation

drivers/gpio: Check return value to silence warning

PATCH In review Nick Krause 2 participants 2 messages Aug 7, 2014 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/gpio: Check return value to silence warning

Check for return value to fix the following error

drivers/gpio/gpio-sch311x.c: In function 'sch311x_gpio_probe':
drivers/gpio/gpio-sch311x.c:286:18: warning: ignoring return value of 'gpiochip_remove', declared with attribute warn_unused_result [-Wunused-result]

in the context we do not need to check but checking makes compiler happy. With help from kernelnewbies.

---
 drivers/gpio/gpio-sch311x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-sch311x.c +1 -1
index f942b80..af35e99 100644
@@ -283,7 +283,7 @@ exit_err:
 	release_region(pdata->runtime_reg + GP1, 6);
 	/* release already registered chips */
 	for (--i; i >= 0; i--)
-		gpiochip_remove(&priv->blocks[i].chip);
+		WARN_ON(gpiochip_remove(&priv->blocks[i].chip));
 	return err;
 }
 
Signature · 1 line
2.0.1
#1 lore raw
Quoted 8 lines · Nick Krause

Check for return value to fix the following error

drivers/gpio/gpio-sch311x.c: In function 'sch311x_gpio_probe':
drivers/gpio/gpio-sch311x.c:286:18: warning: ignoring return value of 'gpiochip_remove', declared with attribute warn_unused_result [-Wunused-result]

in the context we do not need to check but checking makes compiler happy. With help from kernelnewbies.

This patch is not needed: the warn_unused_result has been removed for 3.17, and gpiochip_remove will be changed to return void soon anyway.