lkml.org 
[lkml]   [2021]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] spi: rockchip: avoid objtool warning
    Date
    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
    \
     
     \ /
      Last update: 2021-02-25 13:59    [W:4.281 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site