Re: [RFC PATCH 5/5] scsi: ufs: Prepare HPB read for cached sub-region

Bart Van Assche
2020-06-09T01:23:20Z

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.