Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1228355ybg; Wed, 29 Jul 2020 08:50:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYZ22kuv+DrujmyQtRQf9uiNmtgBUm06plTg2emjTZO+uPWUOaU2dUcIZQg60nHARQDh/3 X-Received: by 2002:a17:906:2f07:: with SMTP id v7mr14386109eji.313.1596037849639; Wed, 29 Jul 2020 08:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596037849; cv=none; d=google.com; s=arc-20160816; b=pxvJYd9OLp4yszz38TCvDEGBoK1w+NLov7hg51kQdv7KZ7FKpkXGh7s+PzYFBN59ro xZH6D0OmwQXMVeynPCKVlvqdOR9QDBJLtejXgXe0I3VHoeq0f6JP42VqUDOZlU7zKCcT r0DjGaj+S+ALL1fJRqC8ku41gH704xvXxPGvgVIrOrAAZNgiDJ8Xh+aWFgMHAzcn4sde ap2WCR4x5B8Opj7hBaQo7B7xdzy+1qeJ4yrKqwWZRXD4jO4zUq/LnCORQzyu+qH4aSm1 3tAOrOI0/DX/xPu1Mo+HXPvqXYefWd8pJTZJPvV+As5jcC/x11CGRuIkeM2Iizb49yRJ GW8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=+nJHAC0hRre2fPtZmeqPR+IfHQYOVOmegMZZdTbLWdo=; b=N8jl/rlu6QoMpogOBImg/uui6sj9cUTDzPbiX317NFLxHPdKI3RS3RAEctWmCXg2x+ NEHjRc0tsFYR5a1r8VOLCzARsaF9sAgIyBbvrFqpXrNdN9kPcmvlGJfEB7lY+7tZEUe7 aIM79eWX19TlTMe1t0uGk0ZlWknK+aifOfVt01wIQvIPAqvaEET0UFpChMXHOkQwqwO5 v/ky2/OeWIMVUunc7RKnW4i15KIMQ4FU8vcrl7FVYaTi0+TEvOV/EfNuyE1OTwy5280H x+HzwQTc1Nc4xLahPrOSI9Lz6lDnqrfA/TADSqJD76uFdkZA3BS21qxmtiplxoEU2kph BDEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=1iBMUU3g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mj19si1293136ejb.291.2020.07.29.08.50.27; Wed, 29 Jul 2020 08:50:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=1iBMUU3g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727115AbgG2Ptd (ORCPT + 99 others); Wed, 29 Jul 2020 11:49:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726365AbgG2Ptd (ORCPT ); Wed, 29 Jul 2020 11:49:33 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE392C061794; Wed, 29 Jul 2020 08:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=+nJHAC0hRre2fPtZmeqPR+IfHQYOVOmegMZZdTbLWdo=; b=1iBMUU3gWhqIVFifZ+fx5AMf6i J1GkLR1STxoS69tlldAnrIwCE8m30IRgKT5bsamv/A4mU/mP7tZMX+n47pv6L+I1O1ciNtl2KeUry tRREARBZ1AaY5aLJUvgFmmnaLTlgb98X5FPD/NbjwboVABr0gLQLKjmKPK+Dzc6pgIF1o3Ak6AP3r S6S3uLT8GeplNRnmKKVAJOB/BZaOHVHhgrg6Zw/S9YQZCyiwQmLgw9c3gxx5ftcq8vwDAb80ng86X R0X6/CFQLkaidGyx/vbcHvCFjxVP14iyKVAKblah+hYYMPBXXPScPcId3HLIKmb/R97wg2M8SWzRR cZlBSWMQ==; Received: from [2601:1c0:6280:3f0::19c2] by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0oKe-0003hl-GR; Wed, 29 Jul 2020 15:49:28 +0000 Subject: Re: [PATCH V7 1/6] clk: imx6sl: Use BIT(x) to avoid shifting signed 32-bit value by 31 bits To: Anson Huang , mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, aisheng.dong@nxp.com, arnd@arndb.de, peng.fan@nxp.com, abel.vesa@nxp.com, fugang.duan@nxp.com, daniel.baluta@nxp.com, yuehaibing@huawei.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Linux-imx@nxp.com References: <1596034117-24246-1-git-send-email-Anson.Huang@nxp.com> <1596034117-24246-2-git-send-email-Anson.Huang@nxp.com> From: Randy Dunlap Message-ID: <86ae1d4e-27c9-07e4-73be-37d490cb0063@infradead.org> Date: Wed, 29 Jul 2020 08:49:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1596034117-24246-2-git-send-email-Anson.Huang@nxp.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/29/20 7:48 AM, Anson Huang wrote: > Use readl_relaxed() instead of __raw_readl(), and use BIT(x) > instead of (1 << X) to fix below build warning reported by kernel > test robot: > > drivers/clk/imx/clk-imx6sl.c:149:49: warning: Shifting signed 32-bit > value by 31 bits is undefined behaviour [shiftTooManyBitsSigned] > while (!(__raw_readl(anatop_base + PLL_ARM) & BM_PLL_ARM_LOCK)) > > Signed-off-by: Anson Huang > Reported-by: kernel test robot > --- > Changes since V6: > - improve the subject. > --- > drivers/clk/imx/clk-imx6sl.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/drivers/clk/imx/clk-imx6sl.c b/drivers/clk/imx/clk-imx6sl.c > index 0f647d1..e69dba1 100644 > --- a/drivers/clk/imx/clk-imx6sl.c > +++ b/drivers/clk/imx/clk-imx6sl.c > @@ -3,6 +3,7 @@ > * Copyright 2013-2014 Freescale Semiconductor, Inc. > */ > > +#include Hi, I think you want #include for BIT() usage. > #include > #include > #include > @@ -14,19 +15,19 @@ > #include "clk.h" > > #define CCSR 0xc > -#define BM_CCSR_PLL1_SW_CLK_SEL (1 << 2) > +#define BM_CCSR_PLL1_SW_CLK_SEL BIT(2) > #define CACRR 0x10 > #define CDHIPR 0x48 > -#define BM_CDHIPR_ARM_PODF_BUSY (1 << 16) > +#define BM_CDHIPR_ARM_PODF_BUSY BIT(16) > #define ARM_WAIT_DIV_396M 2 > #define ARM_WAIT_DIV_792M 4 > #define ARM_WAIT_DIV_996M 6 > > #define PLL_ARM 0x0 > -#define BM_PLL_ARM_DIV_SELECT (0x7f << 0) > -#define BM_PLL_ARM_POWERDOWN (1 << 12) > -#define BM_PLL_ARM_ENABLE (1 << 13) > -#define BM_PLL_ARM_LOCK (1 << 31) > +#define BM_PLL_ARM_DIV_SELECT 0x7f > +#define BM_PLL_ARM_POWERDOWN BIT(12) > +#define BM_PLL_ARM_ENABLE BIT(13) > +#define BM_PLL_ARM_LOCK BIT(31) > #define PLL_ARM_DIV_792M 66 > > static const char *step_sels[] = { "osc", "pll2_pfd2", }; thanks. -- ~Randy