Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1565505ybg; Wed, 29 Jul 2020 18:30:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+VtOIVmUfYSENyLYT/bPqClNm0o72SyaDhGrOox/c2wZBme2nFKpro3K3ntdY+3Z4ZI0Z X-Received: by 2002:aa7:d693:: with SMTP id d19mr496330edr.317.1596072614728; Wed, 29 Jul 2020 18:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596072614; cv=none; d=google.com; s=arc-20160816; b=Am8hO7i4KxZRDlH6L6018YahbtKXHB6l/m+lG5abvykaYOCOVE/TdDLs2b2xnwhACl 02dQ4ByFvyJT3/27YjX4AUlTOjWFTWA7KwJC2XCR2i3BdpjaDDcwMJRFJuI7F92aKT4S bks1+le9B6wJyHqBHJsqDJoVK9gIouEX6KWf36PvE2g1KzDae8TzLhL+kjXS8hWmKQjF DGqf0LnUscfPxF7ZxIp4YEJ2LMGLJmQQVdQcKoOtXaTlyl2SisHY89HW9g4mVAqwKcgM Q6kBJkSa/c02D52t7eBM9rgvI7F86L3vCQxHgJFz1Y2SqsVen74oDNZ0FVXo4ctIz60F ME7A== 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=fcxWwDuuxbamoPzukE4PLSIRYYLAABvVd7ZdNsngtmI=; b=Bj0PvokRI6QtWgY4YP7yXCKfFUcKgGIZFVBKE3yNGPe3YGSbM4nSIVe7LfoXWcPviw HSfi3L2D7yUuTfTcxxVWY364dUPWveZr4fxqcc3CufJejcC4e71YkrpIvIK/ZIAKyIVi 6cn4i5WNGzVOMSmZ9xmitQiaVbsMBJu4xoNqDHJODY8YGYdAYRvGXvhIvX2Hb2ga95di WQEizknvpcfiutcykSwRXj/b9fKVQdqSoDQDh5kGMsKjBDshLK9uoNgYydczu7fKFYdp z4r+Zb2daEpPo9k601+OsTp+C00Qli+l8+6951izSFx3NHYz63h23D7DBSyT8fXzsvG+ wuNw== 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 hb17si2031563ejb.576.2020.07.29.18.29.52; Wed, 29 Jul 2020 18:30:14 -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 S1727769AbgG3B1X (ORCPT + 99 others); Wed, 29 Jul 2020 21:27:23 -0400 Received: from inva020.nxp.com ([92.121.34.13]:42512 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726319AbgG3B1W (ORCPT ); Wed, 29 Jul 2020 21:27:22 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id AB4C61A12E2; Thu, 30 Jul 2020 03:27:20 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 25B3E1A0291; Thu, 30 Jul 2020 03:27:14 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id CF15D40302; Thu, 30 Jul 2020 03:27:05 +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 V9 1/6] clk: imx6sl: Use BIT(x) to avoid shifting signed 32-bit value by 31 bits Date: Thu, 30 Jul 2020 09:22:49 +0800 Message-Id: <1596072174-16358-2-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1596072174-16358-1-git-send-email-Anson.Huang@nxp.com> References: <1596072174-16358-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 V8: - explicitly include linux/bits.h. --- 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..2f93619 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