From: Frantisek Sumsal Date: Sat, 18 Mar 2023 12:56:38 +0000 (+0100) Subject: coccinelle: add a transformation for GNU conditionals X-Git-Tag: v254-rc1~985^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64254629f7e062a39156ee95428d46f2a1e82e06;p=thirdparty%2Fsystemd.git coccinelle: add a transformation for GNU conditionals i.e. x ? x : y => x ?: y --- diff --git a/coccinelle/cond-omit-middle.cocci b/coccinelle/cond-omit-middle.cocci new file mode 100644 index 00000000000..f1587b8db30 --- /dev/null +++ b/coccinelle/cond-omit-middle.cocci @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* See: https://gcc.gnu.org/onlinedocs/gcc/Conditionals.html#Conditionals */ +@@ +expression e, x; +@@ +- e ? e : x ++ e ?: x