Re: [PATCH net-next v13 2/6] net: dsa: Add convenience functions for frame handling
From: Christian Marangi <ansuelsmth@gmail.com>
Date: 2022-09-16 13:55:37
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:quoted
quoted
+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