* [PATCH] ARM: vfp: Silence mvfr0 unused variable warning
@ 2014-11-18 20:56 Stephen Boyd
2014-11-18 21:14 ` Stephen Rothwell
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Boyd @ 2014-11-18 20:56 UTC (permalink / raw)
To: linux-arm-kernel
Stephen Rothwell reports that commit 3f4c9f8f0a20 ("ARM: 8197/1:
vfp: Fix VFPv3 hwcap detection on CPUID based cpus") introduced an
unused variable 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 <sfr@canb.auug.org.au>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
If you apply and use git show -b you can see that most of the diff
is indentation.
arch/arm/vfp/vfpmodule.c | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 5002d002f6e3..216cd78f64aa 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -752,30 +752,30 @@ static int __init vfp_init(void)
* precision floating point operations. Only check
* for NEON if the hardware has the MVFR registers.
*/
-#ifdef CONFIG_NEON
- if ((fmrx(MVFR1) & 0x000fff00) == 0x00011100)
+ if (IS_ENABLED(CONFIG_NEON) &&
+ (fmrx(MVFR1) & 0x000fff00) == 0x00011100)
elf_hwcap |= HWCAP_NEON;
-#endif
-#ifdef CONFIG_VFPv3
- mvfr0 = fmrx(MVFR0);
- if (((mvfr0 & MVFR0_DP_MASK) >> MVFR0_DP_BIT) == 0x2 ||
- ((mvfr0 & MVFR0_SP_MASK) >> MVFR0_SP_BIT) == 0x2) {
- elf_hwcap |= HWCAP_VFPv3;
- /*
- * Check for VFPv3 D16 and VFPv4 D16. CPUs in
- * this configuration only have 16 x 64bit
- * registers.
- */
- if ((mvfr0 & MVFR0_A_SIMD_MASK) == 1)
- /* also v4-D16 */
- elf_hwcap |= HWCAP_VFPv3D16;
- else
- elf_hwcap |= HWCAP_VFPD32;
- }
- if ((fmrx(MVFR1) & 0xf0000000) == 0x10000000)
- elf_hwcap |= HWCAP_VFPv4;
-#endif
+ if (IS_ENABLED(CONFIG_VFPv3)) {
+ mvfr0 = fmrx(MVFR0);
+ if (((mvfr0 & MVFR0_DP_MASK) >> MVFR0_DP_BIT) == 0x2 ||
+ ((mvfr0 & MVFR0_SP_MASK) >> MVFR0_SP_BIT) == 0x2) {
+ elf_hwcap |= HWCAP_VFPv3;
+ /*
+ * Check for VFPv3 D16 and VFPv4 D16. CPUs in
+ * this configuration only have 16 x 64bit
+ * registers.
+ */
+ if ((mvfr0 & MVFR0_A_SIMD_MASK) == 1)
+ /* also v4-D16 */
+ elf_hwcap |= HWCAP_VFPv3D16;
+ else
+ elf_hwcap |= HWCAP_VFPD32;
+ }
+
+ if ((fmrx(MVFR1) & 0xf0000000) == 0x10000000)
+ elf_hwcap |= HWCAP_VFPv4;
+ }
/* Extract the architecture version on pre-cpuid scheme */
} else {
if (vfpsid & FPSID_NODOUBLE) {
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] ARM: vfp: Silence mvfr0 unused variable warning
2014-11-18 20:56 [PATCH] ARM: vfp: Silence mvfr0 unused variable warning Stephen Boyd
@ 2014-11-18 21:14 ` Stephen Rothwell
2014-11-18 21:31 ` Stephen Boyd
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2014-11-18 21:14 UTC (permalink / raw)
To: linux-arm-kernel
Hi Stephen,
On Tue, 18 Nov 2014 12:56:31 -0800 Stephen Boyd <sboyd@codeaurora.org> wrote:
>
> Stephen Rothwell reports that commit 3f4c9f8f0a20 ("ARM: 8197/1:
> vfp: Fix VFPv3 hwcap detection on CPUID based cpus") introduced an
> unused variable 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 <sfr@canb.auug.org.au>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Looks good (though I haven't tested it). One small nit below:
> + if (IS_ENABLED(CONFIG_VFPv3)) {
> + mvfr0 = fmrx(MVFR0);
Now that you have a block here, you could move the declaration of mvfr0
into this block, right?
--
Cheers,
Stephen Rothwell sfr at canb.auug.org.au
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141119/6805172a/attachment-0001.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] ARM: vfp: Silence mvfr0 unused variable warning
2014-11-18 21:14 ` Stephen Rothwell
@ 2014-11-18 21:31 ` Stephen Boyd
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2014-11-18 21:31 UTC (permalink / raw)
To: linux-arm-kernel
On 11/18/2014 01:14 PM, Stephen Rothwell wrote:
> One small nit below:
>> + if (IS_ENABLED(CONFIG_VFPv3)) {
>> + mvfr0 = fmrx(MVFR0);
> Now that you have a block here, you could move the declaration of mvfr0
> into this block, right?
>
Sure I can squash in that change.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-11-18 21:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-18 20:56 [PATCH] ARM: vfp: Silence mvfr0 unused variable warning Stephen Boyd
2014-11-18 21:14 ` Stephen Rothwell
2014-11-18 21:31 ` Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).