Re: [PATCH] ext4: replace ternary operator with min()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On (22/10/25 22:51), wangkailong@xxxxxxx 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.



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux