On Fri, Sep 16, 2022 at 08:06:38AM +0200, Christian Marangi wrote:
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