Linux wireless drivers development
 help / color / mirror / Atom feed
From: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
To: Yury Norov <yury.norov@gmail.com>,
	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: Tue, 20 May 2025 09:24:14 -0700	[thread overview]
Message-ID: <54f50afa-3267-4829-8be6-1542c3fef606@oss.qualcomm.com> (raw)
In-Reply-To: <aA5McagnQw49MElr@yury>

On 4/27/2025 8:25 AM, Yury Norov wrote:
> 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
> 

Yury, did you take this?
If not, I'll take it through the ath tree.


  reply	other threads:[~2025-05-20 16:24 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
2025-05-20 16:24     ` Jeff Johnson [this message]
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=54f50afa-3267-4829-8be6-1542c3fef606@oss.qualcomm.com \
    --to=jeff.johnson@oss.qualcomm.com \
    --cc=chunkeey@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=yury.norov@gmail.com \
    /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