lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y1iKuYLba/hingnG@google.com>
Date:   Wed, 26 Oct 2022 10:17:45 +0900
From:   Sergey Senozhatsky <senozhatsky@...omium.org>
To:     wangkailong@...i.cn
Cc:     tytso@....edu, adilger.kernel@...ger.ca, linkinjeon@...nel.org,
        sfrench@...ba.org, senozhatsky@...omium.org, tom@...pey.com,
        roman.gushchin@...ux.dev, akpm@...ux-foundation.org,
        willy@...radead.org, linux-ext4@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-cifs@...r.kernel.org
Subject: Re: [PATCH] ext4: replace ternary operator with min()

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ