[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230719121608.32105-1-nj.shetty@samsung.com>
Date: Wed, 19 Jul 2023 17:46:08 +0530
From: Nitesh Shetty <nj.shetty@...sung.com>
To: Jens Axboe <axboe@...nel.dk>
Cc: martin.petersen@...cle.com, gost.dev@...sung.com,
Nitesh Shetty <nj.shetty@...sung.com>,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] block: refactor to use helper
Reduce some code by making use of bio_integrity_bytes().
Signed-off-by: Nitesh Shetty <nj.shetty@...sung.com>
---
block/bio-integrity.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index 4533eb491661..8f0af7ac8573 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -199,7 +199,6 @@ bool bio_integrity_prep(struct bio *bio)
unsigned long start, end;
unsigned int len, nr_pages;
unsigned int bytes, offset, i;
- unsigned int intervals;
blk_status_t status;
if (!bi)
@@ -224,10 +223,9 @@ bool bio_integrity_prep(struct bio *bio)
!(bi->flags & BLK_INTEGRITY_GENERATE))
return true;
}
- intervals = bio_integrity_intervals(bi, bio_sectors(bio));
/* Allocate kernel buffer for protection data */
- len = intervals * bi->tuple_size;
+ len = bio_integrity_bytes(bi, bio_sectors(bio));
buf = kmalloc(len, GFP_NOIO);
status = BLK_STS_RESOURCE;
if (unlikely(buf == NULL)) {
--
2.34.1
Powered by blists - more mailing lists