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] [day] [month] [year] [list]
Message-ID: <77cff7ec-0787-5a19-0db6-c7d9e34f7258@ieee.org>
Date:   Fri, 19 Nov 2021 07:14:47 -0600
From:   Alex Elder <elder@...e.org>
To:     Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        elder@...nel.org, davem@...emloft.net, kuba@...nel.org
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] net: ipa: Use 'for_each_clear_bit' when possible

On 11/18/21 1:37 PM, Christophe JAILLET wrote:
> Use 'for_each_clear_bit()' instead of hand writing it. It is much less
> version.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>

I know this just got committed, but thanks, this
is a good improvement.

					-Alex

> ---
>   drivers/net/ipa/ipa_mem.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ipa/ipa_mem.c b/drivers/net/ipa/ipa_mem.c
> index 4337b0920d3d..1e9eae208e44 100644
> --- a/drivers/net/ipa/ipa_mem.c
> +++ b/drivers/net/ipa/ipa_mem.c
> @@ -266,9 +266,7 @@ static bool ipa_mem_valid(struct ipa *ipa, const struct ipa_mem_data *mem_data)
>   	}
>   
>   	/* Now see if any required regions are not defined */
> -	for (mem_id = find_first_zero_bit(regions, IPA_MEM_COUNT);
> -	     mem_id < IPA_MEM_COUNT;
> -	     mem_id = find_next_zero_bit(regions, IPA_MEM_COUNT, mem_id + 1)) {
> +	for_each_clear_bit(mem_id, regions, IPA_MEM_COUNT) {
>   		if (ipa_mem_id_required(ipa, mem_id))
>   			dev_err(dev, "required memory region %u missing\n",
>   				mem_id);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ