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: <20190801163437.GA8360@kroah.com>
Date:   Thu, 1 Aug 2019 18:34:37 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Harsh Jain <harshjain32@...il.com>
Cc:     devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging:kpc2000:Fix dubious x | !y sparse warning

On Thu, Aug 01, 2019 at 12:06:06AM +0530, Harsh Jain wrote:
> Bitwise OR(|) operation with 0 always yield same result.
> It fixes dubious x | !y sparse warning.
> 
> Signed-off-by: Harsh Jain <harshjain32@...il.com>
> ---
>  drivers/staging/kpc2000/kpc2000_i2c.c | 16 +---------------
>  1 file changed, 1 insertion(+), 15 deletions(-)
> 
> diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c b/drivers/staging/kpc2000/kpc2000_i2c.c
> index b108da4..5f027d7c 100644
> --- a/drivers/staging/kpc2000/kpc2000_i2c.c
> +++ b/drivers/staging/kpc2000/kpc2000_i2c.c
> @@ -536,29 +536,15 @@ static u32 i801_func(struct i2c_adapter *adapter)
>  
>  	u32 f =
>  		I2C_FUNC_I2C                     | /* 0x00000001 (I enabled this one) */
> -		!I2C_FUNC_10BIT_ADDR             | /* 0x00000002 */
> -		!I2C_FUNC_PROTOCOL_MANGLING      | /* 0x00000004 */
>  		((priv->features & FEATURE_SMBUS_PEC) ? I2C_FUNC_SMBUS_PEC : 0) | /* 0x00000008 */
> -		!I2C_FUNC_SMBUS_BLOCK_PROC_CALL  | /* 0x00008000 */
>  		I2C_FUNC_SMBUS_QUICK             | /* 0x00010000 */
> -		!I2C_FUNC_SMBUS_READ_BYTE        | /* 0x00020000 */
> -		!I2C_FUNC_SMBUS_WRITE_BYTE       | /* 0x00040000 */
> -		!I2C_FUNC_SMBUS_READ_BYTE_DATA   | /* 0x00080000 */
> -		!I2C_FUNC_SMBUS_WRITE_BYTE_DATA  | /* 0x00100000 */
> -		!I2C_FUNC_SMBUS_READ_WORD_DATA   | /* 0x00200000 */
> -		!I2C_FUNC_SMBUS_WRITE_WORD_DATA  | /* 0x00400000 */
> -		!I2C_FUNC_SMBUS_PROC_CALL        | /* 0x00800000 */
> -		!I2C_FUNC_SMBUS_READ_BLOCK_DATA  | /* 0x01000000 */
> -		!I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | /* 0x02000000 */

This is ok, it is showing you that these bits are explicitly being not
set.  Which is good, now you can go through the list and see that all
are accounted for.

So I think this should stay as-is, thanks.

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ