mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Elder <elder@ieee.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	elder@kernel.org, davem@davemloft.net, kuba@kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] net: ipa: Use 'for_each_clear_bit' when possible
Date: Fri, 19 Nov 2021 07:14:47 -0600	[thread overview]
Message-ID: <77cff7ec-0787-5a19-0db6-c7d9e34f7258@ieee.org> (raw)
In-Reply-To: <07566ce40d155d88b60c643fee2d030989037405.1637264172.git.christophe.jaillet@wanadoo.fr>

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@wanadoo.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);
> 


      parent reply	other threads:[~2021-11-19 13:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18 19:37 Christophe JAILLET
2021-11-19 11:50 ` patchwork-bot+netdevbpf
2021-11-19 13:14 ` Alex Elder [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=77cff7ec-0787-5a19-0db6-c7d9e34f7258@ieee.org \
    --to=elder@ieee.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=davem@davemloft.net \
    --cc=elder@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®