From: Yury Norov <yury.norov@gmail.com>
To: Christian Lamparter <chunkeey@gmail.com>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] wifi: carl9170: micro-optimize carl9170_tx_shift_bm()
Date: Sun, 27 Apr 2025 11:25:37 -0400 [thread overview]
Message-ID: <aA5McagnQw49MElr@yury> (raw)
In-Reply-To: <CAAd0S9BDCqw9XZSe=r5fcJuncUagJoJJ0jOe3fB2=UkyXgjozQ@mail.gmail.com>
On Wed, Mar 26, 2025 at 09:00:33PM +0100, Christian Lamparter wrote:
> Hi,
>
> On Wed, Mar 26, 2025 at 4:52 PM Yury Norov <yury.norov@gmail.com> wrote:
> >
> > The function calls bitmap_empty() just before find_first_bit(). Both
> > functions are O(N). Because find_first_bit() returns >= nbits in case of
> > empty bitmap, the bitmap_empty() test may be avoided.
> >
>
> I looked up bitmap_empty():
> <https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/bitmap.h#n423>
>
> apart from the small_const_nbits stuff (which carl9170 likely does not qualify
> for since from what I remember it's a 128bits bitmap) the function just does:
>
> | return find_first_bit(src, nbits) == nbits;
>
> so yes, find_first_bit runs twice with same parameters... Unless the
> compiler is smart
> enough to detect this and (re-)use the intermediate result later. But
> I haven't check
> if this is the case with any current, old or future compilers. Has anyone?
>
> Anyway, Sure.
>
> > Signed-off-by: Yury Norov <yury.norov@gmail.com>
>
> Acked-by: Christian Lamparter <chunkeey@gmail.com>
Thanks, Chrustian. So, how is that supposed to be merged?
I can move it with bitmap-for-next, unless there's no better
branch.
Thanks,
Yury
next prev parent reply other threads:[~2025-04-27 15:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 15:51 [PATCH] wifi: carl9170: micro-optimize carl9170_tx_shift_bm() Yury Norov
2025-03-26 20:00 ` Christian Lamparter
2025-04-27 15:25 ` Yury Norov [this message]
2025-05-20 16:24 ` Jeff Johnson
2025-05-20 16:32 ` Yury Norov
2025-05-21 1:09 ` Jeff Johnson
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=aA5McagnQw49MElr@yury \
--to=yury.norov@gmail.com \
--cc=chunkeey@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@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