Messages in this thread | | | Date | Wed, 26 Oct 2022 10:17:45 +0900 | From | Sergey Senozhatsky <> | Subject | Re: [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.
| |