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:   Mon, 24 Apr 2023 16:31:39 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Yan Wang <rk.code@...look.com>
Cc:     linus.walleij@...aro.org, brgl@...ev.pl,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1] gpio: mmio: restroe get multiple gpio mask

On Sun, Apr 23, 2023 at 05:06:48PM +0800, Yan Wang wrote:
> Simplify the code,should not modify its logic.

> Fixes: 761b5c30c206 ("gpio: mmio: replace open-coded for_each_set_bit()")

What does it fix?

...

>  	for_each_set_bit(i, mask, gc->bgpio_bits) {
> -		if (test_bit(i, bits))
> -			*set_mask |= bgpio_line2mask(gc, i);
> -		else
> -			*clear_mask |= bgpio_line2mask(gc, i);
> +		if (*mask == 0)
> +			break;

Huh?!

We never enter here if mask is 0. So, do not add a dead code, please.

Moreover, in principle mask can be longer than 1 long, this code simply wrong.

NAK

> +		if (__test_and_clear_bit(i, mask)) {
> +			if (test_bit(i, bits))
> +				*set_mask |= bgpio_line2mask(gc, i);
> +			else
> +				*clear_mask |= bgpio_line2mask(gc, i);
> +		}
>  	}

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ