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] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 16 Sep 2022 08:26:56 +0200
From:   Christian Marangi <ansuelsmth@...il.com>
To:     Vladimir Oltean <olteanv@...il.com>
Cc:     Mattias Forsblad <mattias.forsblad@...il.com>,
        netdev@...r.kernel.org, Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, linux@...linux.org.uk
Subject: Re: [PATCH net-next v13 2/6] net: dsa: Add convenience functions for
 frame handling

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ