scsi: target: remove unnecessary null checking for bio allocation
Subsystems (2)
PATCH 1/1 scsi: target: remove unnecessary null checking for bio allocation
When __GFP_DIRECT_RECLAIM (included in GFP_NOIO) is specified, bio_alloc_bioset() never fails to allocate a bio. For more details, see the comment in bio_alloc_bioset() in block/bio.c
--- drivers/target/target_core_iblock.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/target/target_core_iblock.c +0 -4
@@ -369,10 +369,6 @@ static struct bio *iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num,*/ bio =bio_alloc_bioset (ib_dev->ibd_bd,bio_max_segs (sg_num), opf,GFP_NOIO , &ib_dev->ibd_bio_set); -if (!bio) { -pr_err ("Unable to allocate memory for bio\n" ); -return NULL ; - } bio->bi_private = cmd; bio->bi_end_io = &iblock_bio_done;
Signature · 1 line
2.39.5 (Apple Git-154)
Quoted 3 lines
When
__GFP_DIRECT_RECLAIM(included inGFP_NOIO) is specified,bio_alloc_bioset()never fails to allocate a bio. For more details, see the comment inbio_alloc_bioset()inblock/bio.c
Can a blank line be also omitted together with the mentioned compound statement?
Regards,
Markus
Quoted 6 lines
Quoted 3 lines
When
__GFP_DIRECT_RECLAIM(included inGFP_NOIO) is specified,bio_alloc_bioset()never fails to allocate a bio. For more details, see the comment inbio_alloc_bioset()inblock/bio.c
Thanks. I'll modify the commit message into imperative mood.
Quoted 1 line
Can a blank line be also omitted together with the mentioned compound statement?
Sure, I think so.
I'll submit a v2 patch with the modified commit message and without the blank line.
Regards,
Kohei