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 X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 798A0C636C9 for ; Fri, 16 Jul 2021 01:11:56 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 42A9A613D9 for ; Fri, 16 Jul 2021 01:11:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 42A9A613D9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=hisilicon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:In-Reply-To:MIME-Version:Date: Message-ID:From:References:CC:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=J1HonAF93lE+Aq7AMFnCPNZJKCdAPthu2fOpjC4ZW/M=; b=PaLdQdTPB7BbU1hZ+viYk04ptQ hpv14/OLc0L24fIypcounOAXnn/qOpxf+7Xw4lMRMd84Z+6DaBWaqY5OhM4MHgSctscwGGuWbUpY1 wp9us66uckADFeOU4j5iQZHisAr+d/ioakKeKI/kB1NypMCj2npmB6RFKmDpu41zYa+IEVmegfpZg i8l+VNKpfLMdbId4+io8GSMd3Vm0qoUvXkUNbDblTpNDoi1imcsZPraZPeTqSBXUokAHAldHKcP5B 2jUkTFqG5IxAXib0LAqfB2HHSybLS+JUYDnCCu6yr5VNSa6XH/YAhNcy/vu1Qq5Jc9mZvwRfggPe4 fQ/c74gw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m4CMe-002npH-Fv; Fri, 16 Jul 2021 01:10:04 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m4CMZ-002no9-AY for linux-arm-kernel@lists.infradead.org; Fri, 16 Jul 2021 01:10:01 +0000 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4GQtL263VpzXsyb; Fri, 16 Jul 2021 09:04:10 +0800 (CST) Received: from dggpeml500023.china.huawei.com (7.185.36.114) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 16 Jul 2021 09:09:42 +0800 Received: from [10.67.77.175] (10.67.77.175) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 16 Jul 2021 09:09:41 +0800 Subject: Re: [PATCH] arm64: cpufeature: Use defined macro instead of magic numbers To: Will Deacon CC: , Catalin Marinas , Marc Zyngier References: <1626243183-32937-1-git-send-email-zhangshaokun@hisilicon.com> <20210715163124.GB1330@willie-the-truck> From: Shaokun Zhang Message-ID: Date: Fri, 16 Jul 2021 09:09:41 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210715163124.GB1330@willie-the-truck> Content-Language: en-US X-Originating-IP: [10.67.77.175] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500023.china.huawei.com (7.185.36.114) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210715_180959_643592_7886C5A2 X-CRM114-Status: GOOD ( 14.15 ) 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 Hi Will, On 2021/7/16 0:31, Will Deacon wrote: > On Wed, Jul 14, 2021 at 02:13:03PM +0800, Shaokun Zhang wrote: >> Macro 'CLIDR_LOUU_SHIFT' and 'CLIDR_LOUIS_SHIFT' are defined, so use >> these to replace the magic numbers. >> >> Cc: Catalin Marinas >> Cc: Will Deacon >> Cc: Marc Zyngier >> Signed-off-by: Shaokun Zhang >> --- >> arch/arm64/kernel/cpufeature.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c >> index 125d5c9471ac..4ee3496bcff8 100644 >> --- a/arch/arm64/kernel/cpufeature.c >> +++ b/arch/arm64/kernel/cpufeature.c >> @@ -1733,7 +1733,7 @@ static void cpu_has_fwb(const struct arm64_cpu_capabilities *__unused) >> u64 val = read_sysreg_s(SYS_CLIDR_EL1); >> >> /* Check that CLIDR_EL1.LOU{U,IS} are both 0 */ >> - WARN_ON(val & (7 << 27 | 7 << 21)); >> + WARN_ON(val & (7 << CLIDR_LOUU_SHIFT | 7 << CLIDR_LOUIS_SHIFT)); >> } > > I think this would be even better as: > > WARN_ON(CLIDR_LOUU(val) || CLIDR_LOUIS(val)); Good catch, will follow it in next version. Thanks, Shaokun > > Will > . > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel