2020-12-01 07:23:16

by Shuosheng Huang

[permalink] [raw]
Subject: [PATCH v2] f2fs: Remove unnecessary unlikely()

From: Yangtao Li <[email protected]>

WARN_ON() already contains an unlikely(), so it's not necessary
to use unlikely.

Signed-off-by: Yangtao Li <[email protected]>
Signed-off-by: Shuosheng Huang <[email protected]>
---
v2:
add Signed-off-by
---
fs/f2fs/f2fs.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index cb700d797296..9f33a508fe51 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -33,10 +33,8 @@
#else
#define f2fs_bug_on(sbi, condition) \
do { \
- if (unlikely(condition)) { \
- WARN_ON(1); \
+ if (WARN_ON(condition)) \
set_sbi_flag(sbi, SBI_NEED_FSCK); \
- } \
} while (0)
#endif

--
2.28.0


2020-12-02 01:55:15

by Chao Yu

[permalink] [raw]
Subject: Re: [f2fs-dev] [PATCH v2] f2fs: Remove unnecessary unlikely()

On 2020/12/1 15:17, Shuosheng Huang wrote:
> From: Yangtao Li <[email protected]>
>
> WARN_ON() already contains an unlikely(), so it's not necessary
> to use unlikely.
>
> Signed-off-by: Yangtao Li <[email protected]>
> Signed-off-by: Shuosheng Huang <[email protected]>

Reviewed-by: Chao Yu <[email protected]>

Thanks,