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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 75205C6FD1C for ; Wed, 22 Mar 2023 23:49:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:To:Cc:From:Subject:References: In-Reply-To:MIME-Version:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KMjPMQphCQKnmWYyXxBxT9gePZwJSdLbCCKT2yHuheA=; b=klHtqXLanxxHz6 01moDvZfIZVaajyFV3g4xxa528EqjFmf7oQzb0z4dRs6Ww/wCEOSVPF+9U0gLDqiVLpWJDq6vy5EH lqDQRIgWLZgN9uM06c0YQPLwEQuVRMlLE/X6GQnyBnGrneMwHlbBxfYRkS/CM4BGaIe7ytklv+9lf Blg+pQVK+86og1GbsTkW4dVj2GQmPhOEQrz/tSYajoIWgi34SnILmm3uL5Mc6pGzRIQjcLgGjcpsb KjBu8u+aAU0EYkrWPKLguaZdBZ+XtuV6uDJEdWemMmxFol70drbjZvOMcMC628soAZMJQqKVnlBJJ vPD4OHcJr7myTzVdOHyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pf8CK-000D1w-0s; Wed, 22 Mar 2023 23:48:52 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pf8CG-000D0w-0F for linux-arm-kernel@lists.infradead.org; Wed, 22 Mar 2023 23:48:50 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8E7DEB81E98; Wed, 22 Mar 2023 23:48:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E1EEC433D2; Wed, 22 Mar 2023 23:48:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679528925; bh=wWdLNiCNfnRGyGZ00699DT+v9vg5lBigHWNeZvkgUrw=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=i9V+BBFcNtBZruyQRBAA4M+mpqfzubCFLDCmMm7KReRuxW+R3YTZt7uUqCzDUu/4s 7QNCmWga6UjU7PO8YovoKse2Xlg39DYXAb0yWjfypCUrka7go2ravpJ0aR73J1lQhs PnpNc3sCC7qVWvhBHD+muC0KINu3a+sHecHrzss/Ety6btbusud9twK8AUSJvQWTYS AtenEzJN3YUppXMUwdkXPbr3tLBZ2I/ezzLNBZQCOLujgn88KOs+jMX5FtogxX7qb/ yTNh6gJvMu3zrdgv2oYxHayFGYRDq93imbanJP+6e2K/c9GYl/9G/0HEuLmK/WMmJ0 I0OmqXV1j2BNw== Message-ID: <00c24196e5ceb60b7d69967b73910264.sboyd@kernel.org> MIME-Version: 1.0 In-Reply-To: <20230322195933.GA2828949@dev-arch.thelio-3990X> References: <202303221947.pXP2v4xJ-lkp@intel.com> <81b2a67f89d7f46dd27f6d05606e753f.sboyd@kernel.org> <20230322195933.GA2828949@dev-arch.thelio-3990X> Subject: Re: [clk:clk-sunplus 1/1] drivers/clk/clk-sp7021.c:316:8: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((_m), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsigned char)0, unsigned short: (unsigne... From: Stephen Boyd Cc: Qin Jian , kernel test robot , llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org To: Nathan Chancellor Date: Wed, 22 Mar 2023 16:48:43 -0700 User-Agent: alot/0.10 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230322_164848_399175_2781689D X-CRM114-Status: GOOD ( 27.77 ) 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 Quoting Nathan Chancellor (2023-03-22 12:59:33) > On Wed, Mar 22, 2023 at 10:39:06AM -0700, Stephen Boyd wrote: > > Quoting kernel test robot (2023-03-22 04:17:48) > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-sunplus > > > head: d54c1fd4a51e8fbc7f9da86b0cd338a4f7cd2bb2 > > > commit: d54c1fd4a51e8fbc7f9da86b0cd338a4f7cd2bb2 [1/1] clk: Add Sunplus SP7021 clock driver > > > config: mips-randconfig-r012-20230322 (https://download.01.org/0day-ci/archive/20230322/202303221947.pXP2v4xJ-lkp@intel.com/config) > > > compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7) > > > reproduce (this is a W=1 build): > > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > > > chmod +x ~/bin/make.cross > > > # install mips cross compiling tool for clang build > > > # apt-get install binutils-mipsel-linux-gnu > > > # https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/commit/?id=d54c1fd4a51e8fbc7f9da86b0cd338a4f7cd2bb2 > > > git remote add clk https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git > > > git fetch --no-tags clk clk-sunplus > > > git checkout d54c1fd4a51e8fbc7f9da86b0cd338a4f7cd2bb2 > > > # save the config file > > > mkdir build_dir && cp config build_dir/.config > > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips olddefconfig > > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/clk/ > > > > > > If you fix the issue, kindly add following tag where applicable > > > | Reported-by: kernel test robot > > > | Link: https://lore.kernel.org/oe-kbuild-all/202303221947.pXP2v4xJ-lkp@intel.com/ > > > > > > > Does this fix it? > > > > ---8<--- > > diff --git a/drivers/clk/clk-sp7021.c b/drivers/clk/clk-sp7021.c > > index 8fec14120105..caabbf5e2197 100644 > > --- a/drivers/clk/clk-sp7021.c > > +++ b/drivers/clk/clk-sp7021.c > > @@ -30,9 +30,9 @@ enum { > > P_MAX > > }; > > > > -#define MASK_SEL_FRA GENMASK(1, 1) > > -#define MASK_SDM_MOD GENMASK(2, 2) > > -#define MASK_PH_SEL GENMASK(4, 4) > > +#define MASK_SEL_FRA BITMASK(1) > > +#define MASK_SDM_MOD BITMASK(2) > > +#define MASK_PH_SEL BITMASK(4) > > #define MASK_NFRA GENMASK(12, 6) > > #define MASK_DIVR GENMASK(8, 7) > > #define MASK_DIVN GENMASK(7, 0) > > > > No (BITMASK did not exist but BIT_MASK does). Heh ok. > It looks like clang is > complaining that mask is an unsigned int and it is being compared > against ~0ull, which will always be false. This makes the warning go > away for me, which is similar to commit cfd6fb45cfaf ("crypto: ccree - > avoid out-of-range warnings from clang"), but I am not sure if that is > correct or not. Cool thanks. Can you send it as a proper patch? > > diff --git a/drivers/clk/clk-sp7021.c b/drivers/clk/clk-sp7021.c > index 8fec14120105..11d22043ddd7 100644 > --- a/drivers/clk/clk-sp7021.c > +++ b/drivers/clk/clk-sp7021.c > @@ -41,7 +41,7 @@ enum { > /* HIWORD_MASK FIELD_PREP */ > #define HWM_FIELD_PREP(mask, value) \ > ({ \ > - u32 _m = mask; \ > + u64 _m = mask; \ > (_m << 16) | FIELD_PREP(_m, value); \ > }) > > > For the record, this only happens under W=1 but I think we would like to > eventually enable this warning so it would be good to avoid introducing > new instances. It makes sense to me because FIELD_PREP typically takes a GENMASK input, which is an unsigned long long shifted around. I think I'm building with W=1, but I'm not building with clang. I'll have to go fetch another compiler and put it into circulation. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel