Re: [PATCH 03/16] block: add bdev_zone_no helper

From: Pankaj Raghav
Date: Thu Apr 28 2022 - 11:41:05 EST



On 2022-04-28 01:31, Damien Le Moal wrote:

>> +static inline unsigned int bdev_zone_no(struct block_device *bdev, sector_t sec)
>> +{
>> + struct request_queue *q = bdev_get_queue(bdev);
>> +
>> + if (q)
>
> q is never NULL. So this can be simplified to:
>
That is a good point. I just noticed it in the bdev_get_queue() function
that q can never be NULL. I will fix it up.

All the functions `bdev*` have this pattern, so probably they could be
simplified as well in the future.
> return blk_queue_zone_no(bdev_get_queue(bdev), sector);
>
>> + return blk_queue_zone_no(q, sec);
>> + return 0;
>> +}
>> +
>> static inline unsigned int bdev_max_open_zones(struct block_device *bdev)
>> {
>> struct request_queue *q = bdev_get_queue(bdev);
>
>