Skip to contentSkip to conversation

hv: hide unused label

PATCH In review Arnd Bergmann 4 participants 4 messages Feb 14, 2017 – Mar 1, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hv: hide unused label

This new 32-bit warning just showed up:

arch/x86/hyperv/hv_init.c: In function 'hyperv_init':
arch/x86/hyperv/hv_init.c:167:1: error: label 'register_msr_cs' defined but not used [-Werror=unused-label]

The easiest solution is to move the label up into the existing #ifdef that has the goto.

Fixes dee863b571b0 ("hv: export current Hyper-V clocksource")
---
 arch/x86/hyperv/hv_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/hyperv/hv_init.c +1 -1
index db64baf0e500..8bef70e7f3cc 100644
@@ -158,13 +158,13 @@ void hyperv_init(void)
 		clocksource_register_hz(&hyperv_cs_tsc, NSEC_PER_SEC/100);
 		return;
 	}
+register_msr_cs:
 #endif
 	/*
 	 * For 32 bit guests just use the MSR based mechanism for reading
 	 * the partition counter.
 	 */
 
-register_msr_cs:
 	hyperv_cs = &hyperv_cs_msr;
 	if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE)
 		clocksource_register_hz(&hyperv_cs_msr, NSEC_PER_SEC/100);
Signature · 1 line
2.9.0
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · On Tue, 14 Feb 2017 22:17:17 +0100 Arnd Bergmann <[email protected]> wrote:

This new 32-bit warning just showed up:

arch/x86/hyperv/hv_init.c: In function 'hyperv_init':
arch/x86/hyperv/hv_init.c:167:1: error: label 'register_msr_cs' defined but not used [-Werror=unused-label]

The easiest solution is to move the label up into the existing #ifdef that has the goto.

Fixes dee863b571b0 ("hv: export current Hyper-V clocksource")
#2 lore raw
In reply to Arnd Bergmann
Quoted 20 lines · Arnd Bergmann

This new 32-bit warning just showed up:

arch/x86/hyperv/hv_init.c: In function 'hyperv_init':
arch/x86/hyperv/hv_init.c:167:1: error: label 'register_msr_cs' defined but not used [-Werror=unused-label]

The easiest solution is to move the label up into the existing #ifdef that has the goto.

Fixes dee863b571b0 ("hv: export current Hyper-V clocksource")
---
 arch/x86/hyperv/hv_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/hyperv/hv_init.c +0 -0
index db64baf0e500..8bef70e7f3cc 100644
@@ -158,13 +158,13 @@ void hyperv_init(void)
 		clocksource_register_hz(&hyperv_cs_tsc, NSEC_PER_SEC/100);

arch/x86/hyperv/hv_init.c void hyperv_init(void) · line 167

Quoted 10 lines
arch/x86/hyperv/hv_init.c +1 -1
 		return;
 	}
+register_msr_cs:
 #endif
 	/*
 	 * For 32 bit guests just use the MSR based mechanism for reading
 	 * the partition counter.
 	 */
 
-register_msr_cs:

Now the warning triggers upstream:

arch/x86/hyperv/hv_init.c: In function ‘hyperv_init’:
arch/x86/hyperv/hv_init.c:167:1: warning: label ‘register_msr_cs’ defined but not used [-Wunused-label]

Thanks,

Ingo

#3 lore raw

[tip:x86/urgent] x86/hyperv: Hide unused label

In reply to Arnd Bergmann
x86/hyperv: Hide unused label
Commit-ID:  73667e31a153a66da97feb1584726222504924f8
Gitweb:     http://git.kernel.org/tip/73667e31a153a66da97feb1584726222504924f8
Author:     Arnd Bergmann <[email protected]>
AuthorDate: Tue, 14 Feb 2017 22:17:17 +0100
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Wed, 1 Mar 2017 10:51:40 +0100

x86/hyperv: Hide unused label

This new 32-bit warning just showed up:

arch/x86/hyperv/hv_init.c: In function 'hyperv_init':
arch/x86/hyperv/hv_init.c:167:1: error: label 'register_msr_cs' defined but not used [-Werror=unused-label]

The easiest solution is to move the label up into the existing #ifdef that has the goto.

Fixes dee863b571b0 ("hv: export current Hyper-V clocksource")
Cc Greg Kroah-Hartman <[email protected]>
Cc Haiyang Zhang <[email protected]>
Cc Vitaly Kuznetsov <[email protected]>
Cc "K. Y. Srinivasan" <[email protected]>
---
 arch/x86/hyperv/hv_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/hyperv/hv_init.c +1 -1
index db64baf0..8bef70e 100644
@@ -158,13 +158,13 @@ void hyperv_init(void)
 		clocksource_register_hz(&hyperv_cs_tsc, NSEC_PER_SEC/100);
 		return;
 	}
+register_msr_cs:
 #endif
 	/*
 	 * For 32 bit guests just use the MSR based mechanism for reading
 	 * the partition counter.
 	 */
 
-register_msr_cs:
 	hyperv_cs = &hyperv_cs_msr;
 	if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE)
 		clocksource_register_hz(&hyperv_cs_msr, NSEC_PER_SEC/100);