lkml.org 
[lkml]   [2020]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 5/5] scsi: ufs: Prepare HPB read for cached sub-region
From
Date
On 2020-06-06 11:38, Avri Altman wrote:
>> + for (i = 0; i < bit_len; i++) {
>> + if (test_bit(srgn_offset + i, srgn->mctx->ppn_dirty))
>
> Maybe use a mask or hweight instead of testing bit by bit?

How about using find_next_bit() from include/linux/bitmap.h?

/*
* find_next_bit(addr, nbits, bit) Position next set bit in *addr
* >= bit
*/

Thanks,

Bart.

\
 
 \ /
  Last update: 2020-06-09 03:25    [W:0.101 / U:0.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site