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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux