From: Christian Marangi <ansuelsmth@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Mattias Forsblad <mattias.forsblad@gmail.com>,
netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux@armlinux.org.uk
Subject: Re: [PATCH net-next v13 2/6] net: dsa: Add convenience functions for frame handling
Date: Fri, 16 Sep 2022 08:26:56 +0200 [thread overview]
Message-ID: <63248022.df0a0220.ce30f.be52@mx.google.com> (raw)
In-Reply-To: <20220916134757.migsntozviogv2jh@skbuf>
On Fri, Sep 16, 2022 at 04:47:57PM +0300, Vladimir Oltean wrote:
> On Fri, Sep 16, 2022 at 08:06:38AM +0200, Christian Marangi wrote:
> > > +static inline void dsa_switch_inband_complete(struct dsa_switch *ds, struct completion *completion)
> > > +{
> > > + /* Custom completion? */
> > > + complete(completion ?: &ds->inband_done);
> >
> > Missing handling for custom completion!
> >
> > Should be
> >
> > complete(completion ? completion : &ds->inband_done);
>
> !!!!
>
> https://en.wikipedia.org/wiki/%3F:#C
> https://en.wikipedia.org/wiki/Elvis_operator
>
> | A GNU extension to C allows omitting the second operand, and using
> | implicitly the first operand as the second also:
> |
> | a == x ? : y;
> |
> | The expression is equivalent to
> |
> | a == x ? (a == x) : y;
> |
> | except that if x is an expression, it is evaluated only once. The
> | difference is significant if evaluating the expression has side effects.
> | This shorthand form is sometimes known as the Elvis operator in other
> | languages.
>
> cat ternary.c
> #include <stdio.h>
>
> int main(void)
> {
> printf("%d\n", 3 ?: 4);
> return 0;
> }
>
> make ternary
> ./ternary
> 3
Oh well! The more you know ahahha.
Then sorry for the wrong review but still wouldn't be more
clear/readable with full syntax?
--
Ansuel
next prev parent reply other threads:[~2022-09-16 13:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-16 12:18 [PATCH net-next v13 0/6] net: dsa: qca8k, mv88e6xxx: rmon: Add RMU support Mattias Forsblad
2022-09-16 6:05 ` Christian Marangi
2022-09-16 12:18 ` [PATCH net-next v13 1/6] net: dsa: mv88e6xxx: Add RMU enable for select switches Mattias Forsblad
2022-09-16 12:18 ` [PATCH net-next v13 2/6] net: dsa: Add convenience functions for frame handling Mattias Forsblad
2022-09-16 6:06 ` Christian Marangi
2022-09-16 13:47 ` Vladimir Oltean
2022-09-16 6:26 ` Christian Marangi [this message]
2022-09-16 12:18 ` [PATCH net-next v13 3/6] net: dsa: Introduce dsa tagger data operation Mattias Forsblad
2022-09-16 12:18 ` [PATCH net-next v13 4/6] net: dsa: mv88e6xxxx: Add RMU functionality Mattias Forsblad
2022-09-17 18:02 ` Andrew Lunn
2022-09-17 18:04 ` Andrew Lunn
2022-09-16 12:18 ` [PATCH net-next v13 5/6] net: dsa: mv88e6xxx: rmon: Use RMU for reading RMON data Mattias Forsblad
2022-09-16 12:18 ` [PATCH net-next v13 6/6] net: dsa: qca8k: Use new convenience functions Mattias Forsblad
2022-09-16 6:09 ` Christian Marangi
2022-09-19 5:18 ` Mattias Forsblad
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=63248022.df0a0220.ce30f.be52@mx.google.com \
--to=ansuelsmth@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mattias.forsblad@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=vivien.didelot@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.