linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: Paul Menzel <pmenzel@molgen.mpg.de>
Cc: Neil Brown <neilb@suse.de>, Jes Sorensen <jes@trained-monkey.org>,
	linux-raid@vger.kernel.org
Subject: Re: Ternary Operator (was: [PATCH mdadm v2] super1: report truncated device)
Date: Fri, 22 Jul 2022 08:55:54 +0200	[thread overview]
Message-ID: <20220722085554.00007701@linux.intel.com> (raw)
In-Reply-To: <4cea4ea7-7d59-da76-6518-ef12ec51c09e@molgen.mpg.de>

On Thu, 21 Jul 2022 18:21:46 +0200
Paul Menzel <pmenzel@molgen.mpg.de> wrote:

> Dear Mariusz,
> 
> 
> Am 21.07.22 um 10:19 schrieb Mariusz Tkaczyk:
> 
> > On Wed, 13 Jul 2022 13:48:11 +1000 NeilBrown wrote:  
> 
> […]
> 
> >> +	}
> >> +	printf("          State : %s%s\n",
> >> +	       (__le64_to_cpu(sb->resync_offset)+1)? "active":"clean",
> >> +	       info.space_after > INT64_MAX ? " TRUNCATED DEVICE" : "");  
> > 
> > Could you use standard if instruction to make the code more readable? We are
> > avoiding ternary operators if possible now.  
> 
> That’s news to me. Where is that documented? If find the operator quite 
> useful in situations like this.
> 
> 
Hi Paul,
It was Jes's preference, however I don't remember exactly when and where he
pointed that (and I cannot find it now).

To clarify - I meant inline\ternary if only.

Jes, could you look?

As you said, in this case ternary is useful, so I give it to Neil to decide
if it can be easily replaced. If not- I'm fine with current approach.

Thanks,
Mariusz

  reply	other threads:[~2022-07-22  6:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12  1:00 [PATCH mdadm] super1: report truncated device NeilBrown
     [not found] ` <cff69e79-d681-c9d6-c719-8b10999a558a@molgen.mpg.de>
2022-07-13  3:48   ` [PATCH mdadm v2] " NeilBrown
2022-07-21  8:19     ` Mariusz Tkaczyk
2022-07-21 16:21       ` Ternary Operator (was: [PATCH mdadm v2] super1: report truncated device) Paul Menzel
2022-07-22  6:55         ` Mariusz Tkaczyk [this message]
2022-07-23  4:37       ` [PATCH mdadm v2] super1: report truncated device NeilBrown
2022-07-25  7:42         ` Mariusz Tkaczyk
2022-08-24 15:58           ` Jes Sorensen
2022-08-25  0:24             ` NeilBrown
2022-08-25  7:59               ` Mariusz Tkaczyk
2022-08-25 13:42                 ` Jes Sorensen
2022-08-25 22:55                   ` [PATCH v3] " NeilBrown
2022-08-29 15:46                     ` Jes Sorensen

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=20220722085554.00007701@linux.intel.com \
    --to=mariusz.tkaczyk@linux.intel.com \
    --cc=jes@trained-monkey.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=pmenzel@molgen.mpg.de \
    /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).