projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da9e480
)
ext4: use BUG_ON instead of if condition followed by BUG
author
xu xin
<xu.xin16@zte.com.cn>
Tue, 28 Dec 2021 07:32:52 +0000
(07:32 +0000)
committer
Theodore Ts'o
<tytso@mit.edu>
Mon, 10 Jan 2022 18:25:56 +0000
(13:25 -0500)
BUG_ON would be better.
This issue was detected with the help of Coccinelle.
Reported-by: Zeal robot <zealci@zte.com.cn>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: xu xin <xu.xin16@zte.com.cn>
Link:
https://lore.kernel.org/r/20211228073252.580296-1-xu.xin16@zte.com.cn
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h
patch
|
blob
|
history
diff --git
a/fs/ext4/ext4.h
b/fs/ext4/ext4.h
index
88c240a
..
715ee20
100644
(file)
--- 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);