lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 23 Jun 2018 19:12:37 +0200
From:   christophe leroy <christophe.leroy@....fr>
To:     Mathieu Malaterre <malat@...ian.org>,
        Michael Ellerman <mpe@...erman.id.au>
Cc:     Kate Stewart <kstewart@...uxfoundation.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-kernel@...r.kernel.org, Paul Mackerras <paulus@...ba.org>,
        Philippe Ombredanne <pombredanne@...b.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        linuxppc-dev@...ts.ozlabs.org,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Subject: Re: [PATCH] powerpc/mm: remove warning about ‘type’ being set



Le 22/06/2018 à 21:27, Mathieu Malaterre a écrit :
> ‘type’ is only used when CONFIG_DEBUG_HIGHMEM is set. So add a possibly
> unused tag to variable. Remove warning treated as error with W=1:
> 
>    arch/powerpc/mm/highmem.c:59:6: error: variable ‘type’ set but not used [-Werror=unused-but-set-variable]

Is type neeeded at all when CONFIG_DEBUG_HIGHMEM is not set ?

The call 	type = kmap_atomic_idx();          seems useless when 
CONFIG_DEBUG_HIGHMEM isn't set. Couldn't we just most type definition 
and setting inside the CONFIG_DEBUG_HIGHMEM {} below ?

Alternatively, maybe you could replace the #ifdef CONFIG_DEBUG_HIGHMEM 
by an    if (IS_ENABLED(CONFIG_DEBUG_HIGHMEM)) ?

Christophe

> 
> Signed-off-by: Mathieu Malaterre <malat@...ian.org>
> ---
>   arch/powerpc/mm/highmem.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/mm/highmem.c b/arch/powerpc/mm/highmem.c
> index 668e87d03f9e..82a0e37557a5 100644
> --- a/arch/powerpc/mm/highmem.c
> +++ b/arch/powerpc/mm/highmem.c
> @@ -56,7 +56,7 @@ EXPORT_SYMBOL(kmap_atomic_prot);
>   void __kunmap_atomic(void *kvaddr)
>   {
>   	unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
> -	int type;
> +	int type __maybe_unused;
>   
>   	if (vaddr < __fix_to_virt(FIX_KMAP_END)) {
>   		pagefault_enable();
> 

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ