From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932516AbcKGQbX (ORCPT ); Mon, 7 Nov 2016 11:31:23 -0500 Received: from foss.arm.com ([217.140.101.70]:40212 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932405AbcKGQbT (ORCPT ); Mon, 7 Nov 2016 11:31:19 -0500 Subject: Re: [PATCH 3/3] arm64/fpsimd: Use ID_AA64PFR0_EL1_.* macros To: Alexander Kuleshov , Catalin Marinas , Will Deacon References: <1441303911-9421-1-git-send-email-kuleshovmail@gmail.com> <1441303979-9535-1-git-send-email-kuleshovmail@gmail.com> Cc: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" From: Suzuki K Poulose Message-ID: Date: Mon, 7 Nov 2016 16:31:16 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1441303979-9535-1-git-send-email-kuleshovmail@gmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/09/15 19:12, Alexander Kuleshov wrote: > The 26d75e67c commit (arm64/cpufeature.h: Add macros for a cpu features > testing) provides set of macros for the testing processor's FP and advanced > SIMD features. > > Let's use these macros instead of direct calculation. > > Signed-off-by: Alexander Kuleshov > --- > arch/arm64/kernel/fpsimd.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c > index 44d6f75..12943a5 100644 > --- a/arch/arm64/kernel/fpsimd.c > +++ b/arch/arm64/kernel/fpsimd.c > @@ -27,6 +27,7 @@ > > #include > #include > +#include > > #define FPEXC_IOF (1 << 0) > #define FPEXC_DZF (1 << 1) > @@ -333,13 +334,13 @@ static int __init fpsimd_init(void) > { > u64 pfr = read_cpuid(ID_AA64PFR0_EL1); > > - if (pfr & (0xf << 16)) { > + if (ID_AA64PFR0_EL1_FP(pfr)) { > pr_notice("Floating-point is not implemented\n"); > return 0; > } > elf_hwcap |= HWCAP_FP; > > - if (pfr & (0xf << 20)) > + if (ID_AA64PFR0_EL1_ADV_SIMD(pfr)) > pr_notice("Advanced SIMD is not implemented\n"); > else > elf_hwcap |= HWCAP_ASIMD; > Similar to the previous one, this won't apply anymore. Suzuki