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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 34B8EC433DB for ; Tue, 23 Mar 2021 13:33:08 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A6D9D6191E for ; Tue, 23 Mar 2021 13:33:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6D9D6191E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4XnTNbxPXzm5Zm+qJoAcuYEYnymzX3Diqp4V+fYxk50=; b=PxlPkygFHDoujSQAKA8SicskW G/qw7DW53ydEraYSnkQPS1l6kHvsStww9fis87WRt70UJDltYbk0CP8U4NDlqUmOd0v2vBDIKhXYO g0zblzZiHRQWcOOH93sj2+4ydSRrsGsHQpUgCz+lm31v9B3rDsrYB3nVqjvBMJw2BTjDss6xI6Ixj V5iNXG1orX+DAUkAjN1azjpx4Re6JrpPx3kpDOHO66WDW9qhe1+Ys8/axrgdoNwKrBVBWcDp2r7b2 1FwvCLOkbH2bBxJN7Yvc1FaXQuinVbyKLlzpyvXGXM2zslxFUI4nh6z4tmikrYbh4gRhtMBKiP4ek Asdld/J/w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lOh6r-00F2p4-JU; Tue, 23 Mar 2021 13:30:13 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lOh6n-00F2oV-EB for linux-arm-kernel@lists.infradead.org; Tue, 23 Mar 2021 13:30:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=pGWpm+WB3Vg671czxou6SRrOuPgVTllUUjQ5wW0XDIY=; b=f58mUhhF/qAQqij8j0teM/Nme pOQH4AkaX50UpZeF9hu8EJI4bnuTM3N6r5NGYdyYAzvweSdbETGA+HFcTlK1trrPELb9cSOVyplt1 +rZvhzqNYmIkLLIwlJ0Ew9TQZzNERrxVc+AKo0ZYnllUWDpbLPcGjN+VT7djASfmmUMnhrjbLpPXY ftmK7pRWaDfzD+iylv8tBqKphoI6qSuJEpwUINAScokczMOjq4hb5wArwN4OP38/mvac40zdOHRIW KpiPQiFBGnO44XXWKwjE9geXuv5N7n+wRZgzJW65QlqpFirtjFVncy+8KMdym0ZvVPaN2Jk0OWsVK K/WPz5RKQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:51626) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOh6k-0007ly-7c; Tue, 23 Mar 2021 13:30:06 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lOh6j-0004Bx-In; Tue, 23 Mar 2021 13:30:05 +0000 Date: Tue, 23 Mar 2021 13:30:05 +0000 From: Russell King - ARM Linux admin To: Arnd Bergmann Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] ARM: delay: avoid clang -Wtautological-constant warning Message-ID: <20210323133005.GC1463@shell.armlinux.org.uk> References: <20210323132031.2858996-1-arnd@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210323132031.2858996-1-arnd@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210323_133009_553046_8E94A5C2 X-CRM114-Status: GOOD ( 12.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Mar 23, 2021 at 02:20:23PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > Passing an 8-bit constant into delay() triggers a warning when building > with 'make W=1' using clang: > > drivers/clk/actions/owl-pll.c:182:2: error: result of comparison of constant 2000 with expression of type 'u8' (aka 'unsigned char') is always false [-Werror,-Wtautological-constant-out-of-range-compare] > udelay(pll_hw->delay); > ^~~~~~~~~~~~~~~~~~~~~ > arch/arm/include/asm/delay.h:84:9: note: expanded from macro 'udelay' > ((n) > (MAX_UDELAY_MS * 1000) ? __bad_udelay() : \ > ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~ > arch/arm/mach-omap2/wd_timer.c:89:3: error: result of comparison of constant 2000 with expression of type 'u8' (aka 'unsigned char') is always false [-Werror,-Wtautological-constant-out-of-range-compare] > udelay(oh->class->sysc->srst_udelay); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Shut up the warning by adding a cast to a 64-bit number. A cast to 'int' > would usually be sufficient, but would fail to cause a link-time error > for large 64-bit constants. What effect (if any) does this have on code generation when the argument is not constant? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel