Skip to content

Commit 2b94fe2

Browse files
bebarinoRussell King
authored andcommitted
ARM: 8215/1: vfp: Silence mvfr0 variable unused warning
Stephen Rothwell reports that commit 3f4c9f8 ("ARM: 8197/1: vfp: Fix VFPv3 hwcap detection on CPUID based cpus") introduced a variable unused warning. arch/arm/vfp/vfpmodule.c: In function 'vfp_init': arch/arm/vfp/vfpmodule.c:725:6: warning: unused variable 'mvfr0' [-Wunused-variable] u32 mvfr0; Silence this warning by using IS_ENABLED instead of ifdefs. Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 6c96a4a commit 2b94fe2

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

arch/arm/vfp/vfpmodule.c

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,6 @@ static int __init vfp_init(void)
722722
{
723723
unsigned int vfpsid;
724724
unsigned int cpu_arch = cpu_architecture();
725-
u32 mvfr0;
726725

727726
if (cpu_arch >= CPU_ARCH_ARMv6)
728727
on_each_cpu(vfp_enable, NULL, 1);
@@ -752,30 +751,30 @@ static int __init vfp_init(void)
752751
* precision floating point operations. Only check
753752
* for NEON if the hardware has the MVFR registers.
754753
*/
755-
#ifdef CONFIG_NEON
756-
if ((fmrx(MVFR1) & 0x000fff00) == 0x00011100)
754+
if (IS_ENABLED(CONFIG_NEON) &&
755+
(fmrx(MVFR1) & 0x000fff00) == 0x00011100)
757756
elf_hwcap |= HWCAP_NEON;
758-
#endif
759-
#ifdef CONFIG_VFPv3
760-
mvfr0 = fmrx(MVFR0);
761-
if (((mvfr0 & MVFR0_DP_MASK) >> MVFR0_DP_BIT) == 0x2 ||
762-
((mvfr0 & MVFR0_SP_MASK) >> MVFR0_SP_BIT) == 0x2) {
763-
elf_hwcap |= HWCAP_VFPv3;
764-
/*
765-
* Check for VFPv3 D16 and VFPv4 D16. CPUs in
766-
* this configuration only have 16 x 64bit
767-
* registers.
768-
*/
769-
if ((mvfr0 & MVFR0_A_SIMD_MASK) == 1)
770-
/* also v4-D16 */
771-
elf_hwcap |= HWCAP_VFPv3D16;
772-
else
773-
elf_hwcap |= HWCAP_VFPD32;
774-
}
775757

776-
if ((fmrx(MVFR1) & 0xf0000000) == 0x10000000)
777-
elf_hwcap |= HWCAP_VFPv4;
778-
#endif
758+
if (IS_ENABLED(CONFIG_VFPv3)) {
759+
u32 mvfr0 = fmrx(MVFR0);
760+
if (((mvfr0 & MVFR0_DP_MASK) >> MVFR0_DP_BIT) == 0x2 ||
761+
((mvfr0 & MVFR0_SP_MASK) >> MVFR0_SP_BIT) == 0x2) {
762+
elf_hwcap |= HWCAP_VFPv3;
763+
/*
764+
* Check for VFPv3 D16 and VFPv4 D16. CPUs in
765+
* this configuration only have 16 x 64bit
766+
* registers.
767+
*/
768+
if ((mvfr0 & MVFR0_A_SIMD_MASK) == 1)
769+
/* also v4-D16 */
770+
elf_hwcap |= HWCAP_VFPv3D16;
771+
else
772+
elf_hwcap |= HWCAP_VFPD32;
773+
}
774+
775+
if ((fmrx(MVFR1) & 0xf0000000) == 0x10000000)
776+
elf_hwcap |= HWCAP_VFPv4;
777+
}
779778
/* Extract the architecture version on pre-cpuid scheme */
780779
} else {
781780
if (vfpsid & FPSID_NODOUBLE) {

0 commit comments

Comments
 (0)