Skip to content

Commit a2e3965

Browse files
xu xintytso
authored andcommitted
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]>
1 parent da9e480 commit a2e3965

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/ext4/ext4.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2400,8 +2400,7 @@ ext4_rec_len_from_disk(__le16 dlen, unsigned blocksize)
24002400

24012401
static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize)
24022402
{
2403-
if ((len > blocksize) || (blocksize > (1 << 18)) || (len & 3))
2404-
BUG();
2403+
BUG_ON((len > blocksize) || (blocksize > (1 << 18)) || (len & 3));
24052404
#if (PAGE_SIZE >= 65536)
24062405
if (len < 65536)
24072406
return cpu_to_le16(len);

0 commit comments

Comments
 (0)