lkml.org 
[lkml]   [2022]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ext4: replace ternary operator with min()
On (22/10/25 22:51), wangkailong@jari.cn wrote:
[..]
> @@ -879,7 +879,7 @@ static int oplock_break(struct oplock_info *brk_opinfo, int req_op_level)
>
> err = oplock_break_pending(brk_opinfo, req_op_level);
> if (err)
> - return err < 0 ? err : 0;
> + return min(err, 0);
>
> if (brk_opinfo->open_trunc) {
> /*
> @@ -913,7 +913,7 @@ static int oplock_break(struct oplock_info *brk_opinfo, int req_op_level)
> } else {
> err = oplock_break_pending(brk_opinfo, req_op_level);
> if (err)
> - return err < 0 ? err : 0;
> + return min(err, 0);

Honestly, I don't know. My personal preference would be to keep it as is.
"return min(err, 0)" is a bit unusually looking code. Just my 2 cents.

\
 
 \ /
  Last update: 2022-10-26 03:19    [W:0.035 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site