gpio: aspeed: fix compile testing warning
authorArnd Bergmann <arnd@arndb.de>
Mon, 9 Jul 2018 14:56:03 +0000 (16:56 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 13 Jul 2018 07:05:06 +0000 (09:05 +0200)
Gcc cannot always see that BUG_ON(1) is guaranteed to not
return, so we get a warning message in some configurations:

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

Using a plain BUG() is easier here and avoids the problem.

Fixes: 44ddf559d579 ("gpio: aspeed: Rework register type accessors")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-aspeed.c

index 1e00f40..2342e15 100644 (file)
@@ -240,7 +240,7 @@ static inline void __iomem *bank_reg(struct aspeed_gpio *gpio,
        case reg_cmdsrc1:
                return gpio->base + bank->cmdsrc_regs + GPIO_CMDSRC_1;
        }
-       BUG_ON(1);
+       BUG();
 }
 
 #define GPIO_BANK(x)   ((x) >> 5)