Skip to content

Commit 43c70b1

Browse files
calebsanderaxboe
authored andcommitted
block/merge: remove unnecessary min() with UINT_MAX
In bvec_split_segs(), max_bytes is an unsigned, so it must be less than or equal to UINT_MAX. Remove the unnecessary min(). Prior to commit 67927d2 ("block/merge: count bytes instead of sectors"), the min() was with UINT_MAX >> 9, so it did have an effect. Signed-off-by: Caleb Sander Mateos <csander@purestorage.com> Link: https://lore.kernel.org/r/20250214193637.234702-1-csander@purestorage.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 80e6480 commit 43c70b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/blk-merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ static bool bvec_split_segs(const struct queue_limits *lim,
270270
const struct bio_vec *bv, unsigned *nsegs, unsigned *bytes,
271271
unsigned max_segs, unsigned max_bytes)
272272
{
273-
unsigned max_len = min(max_bytes, UINT_MAX) - *bytes;
273+
unsigned max_len = max_bytes - *bytes;
274274
unsigned len = min(bv->bv_len, max_len);
275275
unsigned total_len = 0;
276276
unsigned seg_size = 0;

0 commit comments

Comments
 (0)