From: Christoph Hellwig Date: Mon, 18 Dec 2023 04:57:28 +0000 (+0100) Subject: xfs: invert a check in xfs_rtallocate_extent_block X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f3e509dd45c226aff268bab3695fded60e18f720;p=linux.git xfs: invert a check in xfs_rtallocate_extent_block Doing a break in the else side of a conditional is rather silly. Invert the check, break ASAP and unindent the other leg. Signed-off-by: Christoph Hellwig Reviewed-by: "Darrick J. Wong" Signed-off-by: Chandan Babu R --- diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 0475693bc1991..abcbd0c95b301 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -283,12 +283,11 @@ xfs_rtallocate_extent_block( /* * If not done yet, find the start of the next free space. */ - if (next < end) { - error = xfs_rtfind_forw(args, next, end, &i); - if (error) - return error; - } else + if (next >= end) break; + error = xfs_rtfind_forw(args, next, end, &i); + if (error) + return error; } /* * Searched the whole thing & didn't find a maxlen free extent.