linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: rockchip: avoid objtool warning
@ 2021-02-25 12:55 Arnd Bergmann
  2021-02-25 14:09 ` Emil Renner Berthing
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Arnd Bergmann @ 2021-02-25 12:55 UTC (permalink / raw)
  To: Mark Brown, Heiko Stuebner, Nathan Chancellor, Nick Desaulniers,
	Emil Renner Berthing
  Cc: Arnd Bergmann, Jon Lin, Chris Ruehl, Alexander Kochetkov,
	Johan Jonker, Vincent Pelletier, linux-spi, linux-arm-kernel,
	linux-rockchip, linux-kernel, clang-built-linux

From: Arnd Bergmann <arnd@arndb.de>

Building this file with clang leads to a an unreachable code path
causing a warning from objtool:

drivers/spi/spi-rockchip.o: warning: objtool: rockchip_spi_transfer_one()+0x2e0: sibling call from callable instruction with modified stack frame

Use BUG() instead of unreachable() to avoid the undefined behavior
if it does happen.

Fixes: 65498c6ae241 ("spi: rockchip: support 4bit words")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/spi/spi-rockchip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 936ef54e0903..972beac1169a 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -521,7 +521,7 @@ static void rockchip_spi_config(struct rockchip_spi *rs,
 		 * ctlr->bits_per_word_mask, so this shouldn't
 		 * happen
 		 */
-		unreachable();
+		BUG();
 	}
 
 	if (use_dma) {
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-03-02  7:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25 12:55 [PATCH] spi: rockchip: avoid objtool warning Arnd Bergmann
2021-02-25 14:09 ` Emil Renner Berthing
2021-02-25 21:16 ` Nick Desaulniers
2021-02-25 21:19 ` Heiko Stübner
2021-02-26  8:15 ` Pratyush Yadav
2021-02-26  9:49   ` Arnd Bergmann
2021-02-26 11:04     ` Pratyush Yadav
2021-02-26 11:15       ` Arnd Bergmann
2021-03-01 23:37 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).