Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1184106ybg; Wed, 29 Jul 2020 07:53:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwydFI4V3MIBn5aRhpGlbyIpRLBlPIeahXCzV2QHJIx6C0XLu60t5Sr3deRVmVHvLHWq0AJ X-Received: by 2002:a17:907:204e:: with SMTP id pg14mr11382845ejb.324.1596034417306; Wed, 29 Jul 2020 07:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596034417; cv=none; d=google.com; s=arc-20160816; b=ayTimuvLiIyS6kxpeISoCu07UJMTwyllOqTYJPPj81Kt5JLLi0snszWhJvsGpNyTwl Uy/asgWpI081E8czLWEQmgM1hVdWPo9SHstb+W2k5kFsgbFuiUJCY9dCAoIZ0W8vTc6l tgIRDF0wvLHROj1B+x0W/Nwt5UwsJ6dyHZ13ADDo0f/CmX48QxsEbY+R8jPiNI1MF+NS /9jyAP34knUnsytGUl6MKzA/ZrsXdoetxWLHgCi0RMK6Uc19D0bTb/2ms8MaNOKiPh5a fW7ul6eElCSm3PajjaXuciKE/I68FVy2qyUCQo9LCW7xs7ZmplEAmoT7lihdRdRnhAvy xbOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=b9EvWhxBliL/ZO06uqDyaApIwMQjqtojgCzLmF0+THU=; b=FDC8HTWmQLey7bMGpENcbO7ldNp9YG0vSv7UPWATrhU1CGoKk9h46H8/mBnSh9Y0Iw R+9Ykpt+zoQlsTxp8YEktJ/a9CAA6/TmI/+FD19XQkeEdrw3//H45MR49dhFqPurlj1z QG0FEwbyWk5eh20qRF2/xBDu0q9jqckMDD93jWduLrfS7M91lXAUpKdELGUf/4hgmACN f1n8Uc8uwWYJ9tM/oPubbLsIueNy1Y+v4Nkwm2f3bX/OshaQlYlbRNjFEgye1jS7Z2fc vjLMW/yYjAvf6j7+m73cEQQMOh4eKQdo+9vTQAw+epsb4GKRWnpfX+2Oot/rIeCu/rfk q5Gg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm10si1473013ejc.432.2020.07.29.07.53.14; Wed, 29 Jul 2020 07:53:37 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726816AbgG2OxG (ORCPT + 99 others); Wed, 29 Jul 2020 10:53:06 -0400 Received: from inva021.nxp.com ([92.121.34.21]:47844 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726711AbgG2OxF (ORCPT ); Wed, 29 Jul 2020 10:53:05 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 3D3E620100A; Wed, 29 Jul 2020 16:53:03 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 9B64D201007; Wed, 29 Jul 2020 16:52:56 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 51D03402F3; Wed, 29 Jul 2020 16:52:48 +0200 (CEST) From: Anson Huang To: 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 Subject: [PATCH V7 1/6] clk: imx6sl: Use BIT(x) to avoid shifting signed 32-bit value by 31 bits Date: Wed, 29 Jul 2020 22:48:32 +0800 Message-Id: <1596034117-24246-2-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1596034117-24246-1-git-send-email-Anson.Huang@nxp.com> References: <1596034117-24246-1-git-send-email-Anson.Huang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 #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", }; @@ -145,7 +146,7 @@ static void imx6sl_enable_pll_arm(bool enable) val |= BM_PLL_ARM_ENABLE; val &= ~BM_PLL_ARM_POWERDOWN; writel_relaxed(val, anatop_base + PLL_ARM); - while (!(__raw_readl(anatop_base + PLL_ARM) & BM_PLL_ARM_LOCK)) + while (!(readl_relaxed(anatop_base + PLL_ARM) & BM_PLL_ARM_LOCK)) ; } else { writel_relaxed(saved_pll_arm, anatop_base + PLL_ARM); -- 2.7.4