gpio: aspeed: avoid return type warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 10 Dec 2019 20:28:31 +0000 (21:28 +0100)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 11 Dec 2019 09:07:22 +0000 (10:07 +0100)
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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpio-aspeed-sgpio.c

index 7e99860ca447ed5f5a345d5cb070955d5cbb3c60..8319812593e31295c40638e3667cfa5a1fda2234 100644 (file)
@@ -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();
        }
 }