diff mbox series

[04/19] powerpc/kvm: Mark variable tmp unused

Message ID 20180322202007.23088-5-malat@debian.org
State Not Applicable
Headers show
Series powerpc/ppc32: make W=1 compilation errors free | expand

Commit Message

Mathieu Malaterre March 22, 2018, 8:19 p.m. UTC
Add gcc attribute unused to variable tmp. Fix warning treated as error with
W=1:

  arch/powerpc/kernel/kvm.c:675:6: error: variable ‘tmp’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/kernel/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christophe Leroy March 23, 2018, 10:08 a.m. UTC | #1
Le 22/03/2018 à 21:19, Mathieu Malaterre a écrit :
> Add gcc attribute unused to variable tmp. Fix warning treated as error with
> W=1:
> 
>    arch/powerpc/kernel/kvm.c:675:6: error: variable ‘tmp’ set but not used [-Werror=unused-but-set-variable]
> 
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
> ---
>   arch/powerpc/kernel/kvm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/kvm.c b/arch/powerpc/kernel/kvm.c
> index 9ad37f827a97..cd3c088283f9 100644
> --- a/arch/powerpc/kernel/kvm.c
> +++ b/arch/powerpc/kernel/kvm.c
> @@ -672,7 +672,7 @@ static void kvm_use_magic_page(void)
>   {
>   	u32 *p;
>   	u32 *start, *end;
> -	u32 tmp;
> +	u32 tmp __maybe_unused;
>   	u32 features;
>   
>   	/* Tell the host to map the magic page to -4096 on all CPUs */
> 

This fonction should use  fault_in_pages_readable() instead of 
hardcoding the verification.

Christophe

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/arch/powerpc/kernel/kvm.c b/arch/powerpc/kernel/kvm.c
index 9ad37f827a97..cd3c088283f9 100644
--- a/arch/powerpc/kernel/kvm.c
+++ b/arch/powerpc/kernel/kvm.c
@@ -672,7 +672,7 @@  static void kvm_use_magic_page(void)
 {
 	u32 *p;
 	u32 *start, *end;
-	u32 tmp;
+	u32 tmp __maybe_unused;
 	u32 features;
 
 	/* Tell the host to map the magic page to -4096 on all CPUs */