mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] f2fs: replace ternary operator with max()
@ 2022-10-29 14:49 wangkailong
  2022-11-01 15:38 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: wangkailong @ 2022-10-29 14:49 UTC (permalink / raw)
  To: jaegeuk, chao; +Cc: linux-f2fs-devel, linux-kernel

Fix the following coccicheck warning:

./fs/f2fs/segment.c:877:24-25: WARNING opportunity for max()

Signed-off-by: KaiLong Wang <wangkailong@jari.cn>
---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index ada21e83d279..6da92518328c 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -874,7 +874,7 @@ block_t f2fs_get_unusable_blocks(struct f2fs_sb_info *sbi)
 	}
 	mutex_unlock(&dirty_i->seglist_lock);
 
-	unusable = holes[DATA] > holes[NODE] ? holes[DATA] : holes[NODE];
+	unusable = max(holes[DATA], holes[NODE]);
 	if (unusable > ovp_holes)
 		return unusable - ovp_holes;
 	return 0;
-- 
2.25.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] f2fs: replace ternary operator with max()
  2022-10-29 14:49 [PATCH] f2fs: replace ternary operator with max() wangkailong
@ 2022-11-01 15:38 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2022-11-01 15:38 UTC (permalink / raw)
  To: wangkailong, jaegeuk; +Cc: linux-f2fs-devel, linux-kernel

On 2022/10/29 22:49, wangkailong@jari.cn wrote:
> Fix the following coccicheck warning:
> 
> ./fs/f2fs/segment.c:877:24-25: WARNING opportunity for max()
> 
> Signed-off-by: KaiLong Wang <wangkailong@jari.cn>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-01 15:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-29 14:49 [PATCH] f2fs: replace ternary operator with max() wangkailong
2022-11-01 15:38 ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®