Re: [PATCH] linux/blkdev.h: Use ilog2() directly in blksize_bits()

2020-05-23 Thread Jens Axboe
On 5/23/20 12:33 PM, Bart Van Assche wrote: > On 2020-05-23 08:50, Kaitao Cheng wrote: >> blksize_bits() can be achieved through ilog2(), and ilog2() is >> more efficient. > > If Jens agrees, how about removing the blksize_bits() function entirely > and to make all callers use ilog2() instead of

Re: [PATCH] linux/blkdev.h: Use ilog2() directly in blksize_bits()

2020-05-23 Thread Bart Van Assche
On 2020-05-23 08:50, Kaitao Cheng wrote: > blksize_bits() can be achieved through ilog2(), and ilog2() is > more efficient. If Jens agrees, how about removing the blksize_bits() function entirely and to make all callers use ilog2() instead of blksize_bits()? Thanks, Bart.

Re: [PATCH] linux/blkdev.h: Use ilog2() directly in blksize_bits()

2020-05-23 Thread Jens Axboe
On 5/23/20 9:50 AM, Kaitao Cheng wrote: > blksize_bits() can be achieved through ilog2(), and ilog2() is > more efficient. I like the simplification, but do you have any results to back up that claim? Is the generated code shorter? Runs faster? -- Jens Axboe

[PATCH] linux/blkdev.h: Use ilog2() directly in blksize_bits()

2020-05-23 Thread Kaitao Cheng
blksize_bits() can be achieved through ilog2(), and ilog2() is more efficient. Signed-off-by: Kaitao Cheng --- include/linux/blkdev.h | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 2b33166b9daf..cce96abac4d4 100644