linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/paravirt: hide unused patch_default label
@ 2016-12-16  9:16 Arnd Bergmann
  2016-12-16  9:51 ` Peter Zijlstra
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2016-12-16  9:16 UTC (permalink / raw)
  To: Ingo Molnar, x86
  Cc: Peter Zijlstra, Arnd Bergmann, Thomas Gleixner, H. Peter Anvin,
	virtualization, linux-kernel

A bugfix introduced a harmless warning:

arch/x86/kernel/paravirt_patch_32.c: In function 'native_patch':
arch/x86/kernel/paravirt_patch_32.c:71:1: error: label 'patch_default' defined but not used [-Werror=unused-label]

This puts it in the same #ifdef as its caller.

Fixes: 45dbea5f55c0 ("x86/paravirt: Fix native_patch()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/kernel/paravirt_patch_32.c | 2 ++
 arch/x86/kernel/paravirt_patch_64.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/arch/x86/kernel/paravirt_patch_32.c b/arch/x86/kernel/paravirt_patch_32.c
index d33ef165b1f8..2b729b1df391 100644
--- a/arch/x86/kernel/paravirt_patch_32.c
+++ b/arch/x86/kernel/paravirt_patch_32.c
@@ -68,7 +68,9 @@ unsigned native_patch(u8 type, u16 clobbers, void *ibuf,
 #endif
 
 	default:
+#if defined(CONFIG_PARAVIRT_SPINLOCKS)
 patch_default:
+#endif
 		ret = paravirt_patch_default(type, clobbers, ibuf, addr, len);
 		break;
 
diff --git a/arch/x86/kernel/paravirt_patch_64.c b/arch/x86/kernel/paravirt_patch_64.c
index f4fcf26c9fce..b5bff128949a 100644
--- a/arch/x86/kernel/paravirt_patch_64.c
+++ b/arch/x86/kernel/paravirt_patch_64.c
@@ -80,7 +80,9 @@ unsigned native_patch(u8 type, u16 clobbers, void *ibuf,
 #endif
 
 	default:
+#if defined(CONFIG_PARAVIRT_SPINLOCKS)
 patch_default:
+#endif
 		ret = paravirt_patch_default(type, clobbers, ibuf, addr, len);
 		break;
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/paravirt: hide unused patch_default label
  2016-12-16  9:16 [PATCH] x86/paravirt: hide unused patch_default label Arnd Bergmann
@ 2016-12-16  9:51 ` Peter Zijlstra
  2016-12-16 10:07   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Zijlstra @ 2016-12-16  9:51 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Ingo Molnar, x86, Thomas Gleixner, H. Peter Anvin,
	virtualization, linux-kernel

On Fri, Dec 16, 2016 at 10:16:35AM +0100, Arnd Bergmann wrote:
> A bugfix introduced a harmless warning:
> 
> arch/x86/kernel/paravirt_patch_32.c: In function 'native_patch':
> arch/x86/kernel/paravirt_patch_32.c:71:1: error: label 'patch_default' defined but not used [-Werror=unused-label]
> 
> This puts it in the same #ifdef as its caller.
> 
> Fixes: 45dbea5f55c0 ("x86/paravirt: Fix native_patch()")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

This seems to work as well and is less invasive


 arch/x86/kernel/paravirt_patch_32.c | 2 +-
 arch/x86/kernel/paravirt_patch_64.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/paravirt_patch_32.c b/arch/x86/kernel/paravirt_patch_32.c
index d33ef165b1f8..553acbbb4d32 100644
--- a/arch/x86/kernel/paravirt_patch_32.c
+++ b/arch/x86/kernel/paravirt_patch_32.c
@@ -68,7 +68,7 @@ unsigned native_patch(u8 type, u16 clobbers, void *ibuf,
 #endif
 
 	default:
-patch_default:
+patch_default: __maybe_unused
 		ret = paravirt_patch_default(type, clobbers, ibuf, addr, len);
 		break;
 
diff --git a/arch/x86/kernel/paravirt_patch_64.c b/arch/x86/kernel/paravirt_patch_64.c
index f4fcf26c9fce..11aaf1eaa0e4 100644
--- a/arch/x86/kernel/paravirt_patch_64.c
+++ b/arch/x86/kernel/paravirt_patch_64.c
@@ -80,7 +80,7 @@ unsigned native_patch(u8 type, u16 clobbers, void *ibuf,
 #endif
 
 	default:
-patch_default:
+patch_default: __maybe_unused
 		ret = paravirt_patch_default(type, clobbers, ibuf, addr, len);
 		break;
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/paravirt: hide unused patch_default label
  2016-12-16  9:51 ` Peter Zijlstra
@ 2016-12-16 10:07   ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2016-12-16 10:07 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, x86, Thomas Gleixner, H. Peter Anvin,
	virtualization, linux-kernel

On Friday, December 16, 2016 10:51:50 AM CET Peter Zijlstra wrote:
> -patch_default:
> +patch_default: __maybe_unused
>                 ret = paravirt_patch_default(type, clobbers, ibuf, addr, len);
>                 break;
> 

Ah, nice, I didn't know you could do that. Yes, please do this instead.

	Arnd

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-16 10:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-16  9:16 [PATCH] x86/paravirt: hide unused patch_default label Arnd Bergmann
2016-12-16  9:51 ` Peter Zijlstra
2016-12-16 10:07   ` Arnd Bergmann

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).