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

From: Bart Van Assche
Date: Mon Jun 08 2020 - 21:23:20 EST


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.