public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] scsi: target: Remove unnecessary null checking for bio allocation
@ 2025-02-02 15:27 Kohei Enju
  0 siblings, 0 replies; only message in thread
From: Kohei Enju @ 2025-02-02 15:27 UTC (permalink / raw)
  To: linux-scsi, target-devel, linux-kernel
  Cc: Martin K . Petersen, Kohei Enju, Kohei Enju

Remove unnecessary null checking because bio_alloc_bioset() is
guaranteed to succeed with __GFP_DIRECT_RECLAIM (included in GFP_NOIO).
For more details, please see the comment in bio_alloc_bioset().

Signed-off-by: Kohei Enju <enjuk@amazon.com>
---
v1: https://lore.kernel.org/target-devel/20250202090208.26890-1-enjuk@amazon.com/T/#u
v1->v2:
 * Fix the commit message to use imperative mood
 * Remove the unnecessary blank line
---
 drivers/target/target_core_iblock.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index c8dc92a7d63e..a53e41212cdd 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -369,11 +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;
 	bio->bi_iter.bi_sector = lba;
-- 
2.39.5 (Apple Git-154)


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-02-02 15:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-02 15:27 [PATCH v2] scsi: target: Remove unnecessary null checking for bio allocation Kohei Enju

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox