lkml.org 
[lkml]   [2022]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 03/16] block: add bdev_zone_no helper
From

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);
>
>

\
 
 \ /
  Last update: 2022-04-28 17:42    [W:1.086 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site