Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1523889ybg; Wed, 29 Jul 2020 17:03:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxm0X/BkIXL2TTEuYEIbR4TAHnkwpsn6gIkuOzru6jnMxAybzcxya0gcONKEz2/U9sOwk5Q X-Received: by 2002:a17:906:4451:: with SMTP id i17mr81469ejp.259.1596067422300; Wed, 29 Jul 2020 17:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596067422; cv=none; d=google.com; s=arc-20160816; b=Ti5fVn6r/lU6vmrOpwCj3J4lx9Z0RU9wyZCrHx+bAFWFDCN30/n1zuba4xTlsag8Cf d8CCO8WAmJNKXcRvwxu78nDn7ordHTACtbwmJvsw+OZQF4aguYwvF8E3jayuFnowVAOJ SBUJD+1+KMNnLDLc/MxjQHLZeA2fL8Z50BTitGjRA4Ilo+1fShZqgaAtOKxgwf86oLOk KhagfFjvZnvpT8yzFnblORk9dpOdkAhjiRs8OvtyidjsHAAREfVDT3UWOxQwiRO+kNYz ljXzfA4lzrt49xpNw/lsUp6QvkwOiPzsJrx+/B00tfpTNEa1E2DOWKHLl5Bp1Wtzrse3 oYwA== 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=vctbwFdqYk9T1gtq1MEBruEgRuIc7yYHfDObsJFUO2k=; b=YBlAGwoulbfoRhBLV3CV1dkvzV5zFjh1ocS26DGRvba71ryNdNMjc3kP+CXE2UscYj rT6dqnb+csDbMgBw+hG4WsQJSEgmgF4VRxMmE2wUIZR/wD++liMBK4PyRvp7I+bzBUFX oQOmJw3FzBzTBLh7b7dtSmBb+pO1pAp6Ni0HNIvtrr486bNNoBeeegseYYUq5BSf94KG cob7aHiAe+XrgHWOJAmYHtVH4+x3hmRVoMPiUUTnAxNme5qxzwUqhfFwdMvTga4in+7H wnnUxkKo88SbmU6apqeEfttEgBTOLsOcu9HL7hONtgWjogRPxEqJ0VrOBk9dKQmjocw+ QtkA== 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 n15si2112634eje.289.2020.07.29.17.03.20; Wed, 29 Jul 2020 17:03:42 -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 S1728160AbgG3ADL (ORCPT + 99 others); Wed, 29 Jul 2020 20:03:11 -0400 Received: from inva021.nxp.com ([92.121.34.21]:48630 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727087AbgG3ADJ (ORCPT ); Wed, 29 Jul 2020 20:03:09 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 272F12010CB; Thu, 30 Jul 2020 02:03:08 +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 9805E2010C8; Thu, 30 Jul 2020 02:03:01 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 4BBCD40302; Thu, 30 Jul 2020 02:02:53 +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 V8 1/6] clk: imx6sl: Use BIT(x) to avoid shifting signed 32-bit value by 31 bits Date: Thu, 30 Jul 2020 07:58:35 +0800 Message-Id: <1596067120-1193-2-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1596067120-1193-1-git-send-email-Anson.Huang@nxp.com> References: <1596067120-1193-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 V7: - remove unnecessary linux/bitfield.h include. --- drivers/clk/imx/clk-imx6sl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/clk/imx/clk-imx6sl.c b/drivers/clk/imx/clk-imx6sl.c index 0f647d1..8894876 100644 --- a/drivers/clk/imx/clk-imx6sl.c +++ b/drivers/clk/imx/clk-imx6sl.c @@ -14,19 +14,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 +145,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