aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxu xin <[email protected]>2021-12-28 07:32:52 +0000
committerTheodore Ts'o <[email protected]>2022-01-10 13:25:56 -0500
commita2e3965df40af2f48ee6c97ed573adb91ced5dac (patch)
tree8533c703653ff81bbd2f6b55fd8d6f2ab27bf9e6
parentda9e480212582b336b97848c69fdd4ac8860065b (diff)
ext4: use BUG_ON instead of if condition followed by BUG
BUG_ON would be better. This issue was detected with the help of Coccinelle. Reported-by: Zeal robot <[email protected]> Reviewed-by: Lukas Czerner <[email protected]> Signed-off-by: xu xin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
-rw-r--r--fs/ext4/ext4.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 88c240a9cc42..715ee206dfe1 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2400,8 +2400,7 @@ ext4_rec_len_from_disk(__le16 dlen, unsigned blocksize)
static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize)
{
- if ((len > blocksize) || (blocksize > (1 << 18)) || (len & 3))
- BUG();
+ BUG_ON((len > blocksize) || (blocksize > (1 << 18)) || (len & 3));
#if (PAGE_SIZE >= 65536)
if (len < 65536)
return cpu_to_le16(len);