public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Kohei Enju <enjuk@amazon.com>
To: <linux-scsi@vger.kernel.org>, <target-devel@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	Kohei Enju <kohei.enju@gmail.com>, Kohei Enju <enjuk@amazon.com>
Subject: [PATCH v2] scsi: target: Remove unnecessary null checking for bio allocation
Date: Mon, 3 Feb 2025 00:27:53 +0900	[thread overview]
Message-ID: <20250202152753.22685-1-enjuk@amazon.com> (raw)

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)


                 reply	other threads:[~2025-02-02 15:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250202152753.22685-1-enjuk@amazon.com \
    --to=enjuk@amazon.com \
    --cc=kohei.enju@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox