linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: wangkailong@jari.cn
Cc: tytso@mit.edu, adilger.kernel@dilger.ca, linkinjeon@kernel.org,
	sfrench@samba.org, senozhatsky@chromium.org, tom@talpey.com,
	roman.gushchin@linux.dev, akpm@linux-foundation.org,
	willy@infradead.org, linux-ext4@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-cifs@vger.kernel.org
Subject: Re: [PATCH] ext4: replace ternary operator with min()
Date: Wed, 26 Oct 2022 10:17:45 +0900	[thread overview]
Message-ID: <Y1iKuYLba/hingnG@google.com> (raw)
In-Reply-To: <5036013e.4.1840fa09d42.Coremail.wangkailong@jari.cn>

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.

      reply	other threads:[~2022-10-26  1:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25 14:51 [PATCH] ext4: replace ternary operator with min() wangkailong
2022-10-26  1:17 ` Sergey Senozhatsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y1iKuYLba/hingnG@google.com \
    --to=senozhatsky@chromium.org \
    --cc=adilger.kernel@dilger.ca \
    --cc=akpm@linux-foundation.org \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roman.gushchin@linux.dev \
    --cc=sfrench@samba.org \
    --cc=tom@talpey.com \
    --cc=tytso@mit.edu \
    --cc=wangkailong@jari.cn \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).