mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-01 16:02:14 -05:00
wifi: carl9170: micro-optimize carl9170_tx_shift_bm()
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. Signed-off-by: Yury Norov <yury.norov@gmail.com> Acked-by: Christian Lamparter <chunkeey@gmail.com> Link: https://patch.msgid.link/20250326155200.39895-1-yury.norov@gmail.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
This commit is contained in:
@@ -366,8 +366,7 @@ static void carl9170_tx_shift_bm(struct ar9170 *ar,
|
||||
if (WARN_ON_ONCE(off >= CARL9170_BAW_BITS))
|
||||
return;
|
||||
|
||||
if (!bitmap_empty(tid_info->bitmap, off))
|
||||
off = find_first_bit(tid_info->bitmap, off);
|
||||
off = min(off, find_first_bit(tid_info->bitmap, off));
|
||||
|
||||
tid_info->bsn += off;
|
||||
tid_info->bsn &= 0x0fff;
|
||||
|
||||
Reference in New Issue
Block a user