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=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 80848C433DB for ; Fri, 26 Feb 2021 08:17:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3943464EE2 for ; Fri, 26 Feb 2021 08:17:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229498AbhBZIRS (ORCPT ); Fri, 26 Feb 2021 03:17:18 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:48592 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbhBZIRR (ORCPT ); Fri, 26 Feb 2021 03:17:17 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 11Q8FovB105037; Fri, 26 Feb 2021 02:15:50 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1614327350; bh=M1DX4Z5TbpoNhnKn+jRkQPGNQQ6oXlmXqLr7m8RL0SA=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=EVXzNnfm8cSnMp0cZsY/C8lWzb9/zww+1Vf/mRyQ2Jqb7RGM9rvOwgWjmzAXL51bz D09Zgq6E0VQiWBAzUDqpT9xj5L36vT0/U16rbkd6XyQpLlG4YPWnmal/3jR3VIRgYb EvVnzHOWEwEogWR7YOxGI19Awmu40iTXHwt25/XY= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 11Q8FodB039421 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 26 Feb 2021 02:15:50 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Fri, 26 Feb 2021 02:15:50 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Fri, 26 Feb 2021 02:15:50 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 11Q8FnDe107039; Fri, 26 Feb 2021 02:15:49 -0600 Date: Fri, 26 Feb 2021 13:45:48 +0530 From: Pratyush Yadav To: Arnd Bergmann CC: Mark Brown , Heiko Stuebner , Nathan Chancellor , Nick Desaulniers , Emil Renner Berthing , Arnd Bergmann , Jon Lin , Chris Ruehl , Alexander Kochetkov , Johan Jonker , Vincent Pelletier , , , , , Subject: Re: [PATCH] spi: rockchip: avoid objtool warning Message-ID: <20210226081548.h5ls5fxihunzxjvx@ti.com> References: <20210225125541.1808719-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20210225125541.1808719-1-arnd@kernel.org> User-Agent: NeoMutt/20171215 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Hi, On 25/02/21 01:55PM, Arnd Bergmann wrote: > 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 > --- > 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(); checkpatch says: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() Which makes sense to me. This is not something bad enough to justify crashing the kernel. > } > > if (use_dma) { > -- > 2.29.2 > -- Regards, Pratyush Yadav Texas Instruments Inc.