From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 516DEC433E6 for ; Thu, 25 Feb 2021 21:20:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F2BE164E24 for ; Thu, 25 Feb 2021 21:20:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233556AbhBYVUl (ORCPT ); Thu, 25 Feb 2021 16:20:41 -0500 Received: from gloria.sntech.de ([185.11.138.130]:43762 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233242AbhBYVUh (ORCPT ); Thu, 25 Feb 2021 16:20:37 -0500 Received: from [95.90.166.74] (helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lFO2n-00059G-1g; Thu, 25 Feb 2021 22:19:33 +0100 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Mark Brown , Nathan Chancellor , Nick Desaulniers , Emil Renner Berthing , Arnd Bergmann Cc: Arnd Bergmann , Jon Lin , Chris Ruehl , Alexander Kochetkov , Johan Jonker , Vincent Pelletier , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] spi: rockchip: avoid objtool warning Date: Thu, 25 Feb 2021 22:19:32 +0100 Message-ID: <5587539.MhkbZ0Pkbq@diego> In-Reply-To: <20210225125541.1808719-1-arnd@kernel.org> References: <20210225125541.1808719-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Donnerstag, 25. Februar 2021, 13:55:34 CET schrieb Arnd Bergmann: > From: Arnd Bergmann > > 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 Acked-by: Heiko Stuebner > --- > 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) { >