Skip to contentSkip to conversation

gpio: aspeed: avoid return type warning

PATCH In review Arnd Bergmann 3 participants 3 messages Dec 10, 2019 – Dec 11, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: aspeed: avoid return type warning

gcc has a hard time tracking whether BUG_ON(1) ends execution or not:

drivers/gpio/gpio-aspeed-sgpio.c: In function 'bank_reg':
drivers/gpio/gpio-aspeed-sgpio.c:112:1: error: control reaches end of non-void function [-Werror=return-type]

Use the simpler BUG() that gcc knows cannot continue.

Fixes f8b410e3695a ("gpio: aspeed-sgpio: Rename and add Kconfig/Makefile")
---
 drivers/gpio/gpio-aspeed-sgpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-aspeed-sgpio.c +1 -1
index 7e99860ca447..8319812593e3 100644
@@ -107,7 +107,7 @@ static void __iomem *bank_reg(struct aspeed_sgpio *gpio,
 		return gpio->base + bank->irq_regs + GPIO_IRQ_STATUS;
 	default:
 		/* acturally if code runs to here, it's an error case */
-		BUG_ON(1);
+		BUG();
 	}
 }
 
Signature · 1 line
2.20.0
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Arnd Bergmann

gcc has a hard time tracking whether BUG_ON(1) ends execution or not:

drivers/gpio/gpio-aspeed-sgpio.c: In function 'bank_reg':
drivers/gpio/gpio-aspeed-sgpio.c:112:1: error: control reaches end of non-void function [-Werror=return-type]

Use the simpler BUG() that gcc knows cannot continue.

Fixes f8b410e3695a ("gpio: aspeed-sgpio: Rename and add Kconfig/Makefile")
#2 lore raw

wt., 10 gru 2019 o 23:10 Andrew Jeffery <[email protected]> napisa?(a):

Quoted 11 lines · Arnd Bergmann
Quoted 7 lines

gcc has a hard time tracking whether BUG_ON(1) ends execution or not:

drivers/gpio/gpio-aspeed-sgpio.c: In function 'bank_reg':
drivers/gpio/gpio-aspeed-sgpio.c:112:1: error: control reaches end of non-void function [-Werror=return-type]

Quoted 6 lines
Quoted 4 lines

Use the simpler BUG() that gcc knows cannot continue.

Fixes f8b410e3695a ("gpio: aspeed-sgpio: Rename and add Kconfig/Makefile")

Applied for fixes.

Bartosz