[PATCH V9 6/9] nvmet: add bio init helper for different backends
Damien Le Moal
Damien.LeMoal at wdc.com
Tue Jan 12 01:27:22 EST 2021
On 2021/01/12 14:57, Chaitanya Kulkarni wrote:
> On 1/11/21 21:40, Damien Le Moal wrote:
>>> bio = nvmet_req_bio_get(req, NULL);
>>> - bio_set_dev(bio, req->ns->bdev);
>>> - bio->bi_iter.bi_sector = sect;
>>> - bio->bi_opf = REQ_OP_ZONE_APPEND | REQ_SYNC | REQ_IDLE;
>>> + nvmet_bio_init(bio, req->ns->bdev, op, sect, NULL, NULL);
>> op is used only here I think. So is that variable really necessary ?
>>
> This is just my personal preference as without using op we will have to
> add a new line to a function call, I like to keep the function call in
> one line as much as I can.
A new line in the code costs nothing. An unnecessary variable costs stack space...
--
Damien Le Moal
Western Digital Research
More information about the Linux-nvme
mailing list