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]
Message-ID: <e027b620-56f8-7d8b-84ff-54839f94a4c7@kernel.org>
Date:   Thu, 5 Nov 2020 08:39:56 +0100
From:   Jiri Slaby <jirislaby@...nel.org>
To:     Christophe Leroy <christophe.leroy@...roup.eu>,
        Lee Jones <lee.jones@...aro.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
        Paul Mackerras <paulus@...ba.org>, linux-serial@...r.kernel.org
Subject: Re: [PATCH 34/36] tty: serial: pmac_zilog: Make disposable variable
 __always_unused

On 05. 11. 20, 8:04, Christophe Leroy wrote:
> 
> 
> Le 04/11/2020 à 20:35, Lee Jones a écrit :
>> Fixes the following W=1 kernel build warning(s):
>>
>>   drivers/tty/serial/pmac_zilog.h:365:58: warning: variable ‘garbage’ 
>> set but not used [-Wunused-but-set-variable]
> 
> Explain how you are fixing this warning.
> 
> Setting  __always_unused is usually not the good solution for fixing 
> this warning, but here I guess this is likely the good solution. But it 
> should be explained why.

Or, why is the "garbage =" needed in the first place? read_zsdata is not 
defined with __warn_unused_result__. And even if it was, would 
(void)!read_zsdata(port) fix it?

>> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
>> Cc: Jiri Slaby <jirislaby@...nel.org>
>> Cc: Michael Ellerman <mpe@...erman.id.au>
>> Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
>> Cc: Paul Mackerras <paulus@...ba.org>
>> Cc: linux-serial@...r.kernel.org
>> Cc: linuxppc-dev@...ts.ozlabs.org
>> Signed-off-by: Lee Jones <lee.jones@...aro.org>
>> ---
>>   drivers/tty/serial/pmac_zilog.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/tty/serial/pmac_zilog.h 
>> b/drivers/tty/serial/pmac_zilog.h
>> index bb874e76810e0..968aec7c1cf82 100644
>> --- a/drivers/tty/serial/pmac_zilog.h
>> +++ b/drivers/tty/serial/pmac_zilog.h
>> @@ -362,7 +362,7 @@ static inline void zssync(struct uart_pmac_port 
>> *port)
>>   /* Misc macros */
>>   #define ZS_CLEARERR(port)    (write_zsreg(port, 0, ERR_RES))
>> -#define ZS_CLEARFIFO(port)   do { volatile unsigned char garbage; \
>> +#define ZS_CLEARFIFO(port)   do { volatile unsigned char 
>> __always_unused garbage; \
>>                        garbage = read_zsdata(port); \
>>                        garbage = read_zsdata(port); \
>>                        garbage = read_zsdata(port); \
>>

thanks,
-- 
js

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ