From 64b92d637c7bc22b22463f35722f1b63b2db11b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 1 Oct 2021 12:28:36 +0200 Subject: [PATCH] licensing: add spdx to our .cocci files Since those are chunks of code based on our codebase, it's easiest to use the same license. --- coccinelle/bool-cast.cocci | 1 + coccinelle/close-above-stdio.cocci | 1 + coccinelle/cmp.cocci | 1 + coccinelle/const-strlen.disabled | 1 + coccinelle/debug-logging.cocci | 1 + coccinelle/div-round-up.cocci | 1 + coccinelle/dup-fcntl.cocci | 1 + coccinelle/empty-or-dash.cocci | 1 + coccinelle/empty-or-root.cocci | 1 + coccinelle/empty-to-null.cocci | 1 + coccinelle/empty-to-root.cocci | 1 + coccinelle/enotsup.cocci | 1 + coccinelle/equals-null.cocci | 1 + coccinelle/errno-check.cocci | 1 + coccinelle/errno.cocci | 1 + coccinelle/exit-0.cocci | 1 + coccinelle/flags-set.cocci | 1 + coccinelle/fopen-unlocked.cocci | 1 + coccinelle/free_and_replace.cocci | 1 + coccinelle/hashmap_free.cocci | 1 + coccinelle/htonl.cocci | 1 + coccinelle/in_set.cocci | 1 + coccinelle/iovec-make.cocci | 1 + coccinelle/isempty.cocci | 1 + coccinelle/log-json.cocci | 1 + coccinelle/macros.h | 4 +++- coccinelle/malloc_multiply.cocci | 1 + coccinelle/memzero.cocci | 1 + coccinelle/mfree.cocci | 1 + coccinelle/mfree_return.cocci | 1 + coccinelle/no-if-assignments.cocci | 1 + coccinelle/not_in_set.cocci | 1 + coccinelle/o-ndelay.cocci | 1 + coccinelle/reallocarray.cocci | 1 + coccinelle/redundant-if.cocci | 1 + coccinelle/safe_close-no-if.cocci | 1 + coccinelle/safe_close.cocci | 1 + coccinelle/safe_closedir.cocci | 1 + coccinelle/safe_fclose.cocci | 1 + coccinelle/sd_event_source_disable_unref.cocci | 1 + coccinelle/set_ensure_put.cocci | 1 + coccinelle/strempty.cocci | 1 + coccinelle/strjoin.cocci | 1 + coccinelle/strjoina.cocci | 1 + coccinelle/strv_free.cocci | 1 + coccinelle/swap-two.cocci | 1 + coccinelle/synthetic-errno.cocci | 1 + coccinelle/take-fd.cocci | 1 + coccinelle/take-ptr.cocci | 1 + coccinelle/while-true.cocci | 1 + coccinelle/xsprintf.cocci | 1 + coccinelle/zz-drop-braces.cocci | 1 + 52 files changed, 54 insertions(+), 1 deletion(-) diff --git a/coccinelle/bool-cast.cocci b/coccinelle/bool-cast.cocci index 051ccb94175..a3311f06599 100644 --- a/coccinelle/bool-cast.cocci +++ b/coccinelle/bool-cast.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ bool b; expression y; diff --git a/coccinelle/close-above-stdio.cocci b/coccinelle/close-above-stdio.cocci index 44b3b1c9f1e..93a0a85978d 100644 --- a/coccinelle/close-above-stdio.cocci +++ b/coccinelle/close-above-stdio.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression fd; @@ diff --git a/coccinelle/cmp.cocci b/coccinelle/cmp.cocci index a34cbe5bf60..d5ab0f245e4 100644 --- a/coccinelle/cmp.cocci +++ b/coccinelle/cmp.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression x, y; @@ diff --git a/coccinelle/const-strlen.disabled b/coccinelle/const-strlen.disabled index 30a6e5a88ed..8b1a635274c 100644 --- a/coccinelle/const-strlen.disabled +++ b/coccinelle/const-strlen.disabled @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ constant s; @@ diff --git a/coccinelle/debug-logging.cocci b/coccinelle/debug-logging.cocci index a679dab0115..2885350f852 100644 --- a/coccinelle/debug-logging.cocci +++ b/coccinelle/debug-logging.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ @@ ( diff --git a/coccinelle/div-round-up.cocci b/coccinelle/div-round-up.cocci index a0c6df9801f..609ec879d3b 100644 --- a/coccinelle/div-round-up.cocci +++ b/coccinelle/div-round-up.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression x, y; @@ diff --git a/coccinelle/dup-fcntl.cocci b/coccinelle/dup-fcntl.cocci index 8b133b3a24f..2c87f70dc3d 100644 --- a/coccinelle/dup-fcntl.cocci +++ b/coccinelle/dup-fcntl.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ /* We want to stick with dup() in test-fd-util.c */ position p : script:python() { p[0].file != "src/test/test-fd-util.c" }; diff --git a/coccinelle/empty-or-dash.cocci b/coccinelle/empty-or-dash.cocci index bebaead2ffe..56246affaa0 100644 --- a/coccinelle/empty-or-dash.cocci +++ b/coccinelle/empty-or-dash.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression s; @@ diff --git a/coccinelle/empty-or-root.cocci b/coccinelle/empty-or-root.cocci index bf2f614da67..d36f0c8b1bf 100644 --- a/coccinelle/empty-or-root.cocci +++ b/coccinelle/empty-or-root.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression s; @@ diff --git a/coccinelle/empty-to-null.cocci b/coccinelle/empty-to-null.cocci index bc6c656e798..1cc89475a6f 100644 --- a/coccinelle/empty-to-null.cocci +++ b/coccinelle/empty-to-null.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ /* Avoid running this transformation on the empty_to_null function itself */ position p : script:python() { p[0].current_element != "empty_to_null" }; diff --git a/coccinelle/empty-to-root.cocci b/coccinelle/empty-to-root.cocci index 3720497bef9..9a65a6936f2 100644 --- a/coccinelle/empty-to-root.cocci +++ b/coccinelle/empty-to-root.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression s; @@ diff --git a/coccinelle/enotsup.cocci b/coccinelle/enotsup.cocci index c65734d382c..47ac4b748b9 100644 --- a/coccinelle/enotsup.cocci +++ b/coccinelle/enotsup.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ @@ - ENOTSUP diff --git a/coccinelle/equals-null.cocci b/coccinelle/equals-null.cocci index 3fce0f4caae..92c70540130 100644 --- a/coccinelle/equals-null.cocci +++ b/coccinelle/equals-null.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression e; statement s; diff --git a/coccinelle/errno-check.cocci b/coccinelle/errno-check.cocci index 709cb4ace6f..f6f0071cd11 100644 --- a/coccinelle/errno-check.cocci +++ b/coccinelle/errno-check.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ constant c; @@ diff --git a/coccinelle/errno.cocci b/coccinelle/errno.cocci index 4e594e7826c..dd886ea4930 100644 --- a/coccinelle/errno.cocci +++ b/coccinelle/errno.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ identifier log_LEVEL_errno =~ "^log_(debug|info|notice|warning|error|emergency)_errno$"; local idexpression r; diff --git a/coccinelle/exit-0.cocci b/coccinelle/exit-0.cocci index 8b81600579a..ff3d965a9d0 100644 --- a/coccinelle/exit-0.cocci +++ b/coccinelle/exit-0.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ @@ - exit(0); diff --git a/coccinelle/flags-set.cocci b/coccinelle/flags-set.cocci index 22620f18490..bcf08db23ba 100644 --- a/coccinelle/flags-set.cocci +++ b/coccinelle/flags-set.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ /* Disable this transformation in cases where it doesn't make sense or * where it makes the resulting expression more confusing diff --git a/coccinelle/fopen-unlocked.cocci b/coccinelle/fopen-unlocked.cocci index 7870f8ccea0..1caa698c7bc 100644 --- a/coccinelle/fopen-unlocked.cocci +++ b/coccinelle/fopen-unlocked.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression f, path, options; @@ diff --git a/coccinelle/free_and_replace.cocci b/coccinelle/free_and_replace.cocci index 9dcdbf4d42a..7d8b6a738cd 100644 --- a/coccinelle/free_and_replace.cocci +++ b/coccinelle/free_and_replace.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression p, q; @@ diff --git a/coccinelle/hashmap_free.cocci b/coccinelle/hashmap_free.cocci index 86b95424889..31e1279ac0a 100644 --- a/coccinelle/hashmap_free.cocci +++ b/coccinelle/hashmap_free.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression p; @@ diff --git a/coccinelle/htonl.cocci b/coccinelle/htonl.cocci index 4e69bb70902..c247d24e9bc 100644 --- a/coccinelle/htonl.cocci +++ b/coccinelle/htonl.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression s; @@ diff --git a/coccinelle/in_set.cocci b/coccinelle/in_set.cocci index 1c17c7df1f4..8be786dc2d9 100644 --- a/coccinelle/in_set.cocci +++ b/coccinelle/in_set.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* Limit the number of expressions to 6 for performance reasons */ @@ expression e; diff --git a/coccinelle/iovec-make.cocci b/coccinelle/iovec-make.cocci index 7a0d4ced9b8..79116882fc7 100644 --- a/coccinelle/iovec-make.cocci +++ b/coccinelle/iovec-make.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression x, y, p, l; @@ diff --git a/coccinelle/isempty.cocci b/coccinelle/isempty.cocci index e0a9f07ca6d..b1b92772707 100644 --- a/coccinelle/isempty.cocci +++ b/coccinelle/isempty.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ /* Disable this transformation for the test-string-util.c */ position p : script:python() { p[0].file != "src/test/test-string-util.c" }; diff --git a/coccinelle/log-json.cocci b/coccinelle/log-json.cocci index 3730fd6ea33..d184e565845 100644 --- a/coccinelle/log-json.cocci +++ b/coccinelle/log-json.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression e, v, flags; expression list args; diff --git a/coccinelle/macros.h b/coccinelle/macros.h index 62177f0d86c..0be4aaea427 100644 --- a/coccinelle/macros.h +++ b/coccinelle/macros.h @@ -1,4 +1,6 @@ -/* Collected macros from our systemd codebase to make the cocci semantic +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Collected macros from our systemd codebase to make the cocci semantic * parser happy. Inspired by the original cocci macros file * /usr/lib64/coccinelle/standard.h (including the YACFE_* symbols) */ diff --git a/coccinelle/malloc_multiply.cocci b/coccinelle/malloc_multiply.cocci index 3284edf7378..320d257bd9b 100644 --- a/coccinelle/malloc_multiply.cocci +++ b/coccinelle/malloc_multiply.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression q, n, m; @@ diff --git a/coccinelle/memzero.cocci b/coccinelle/memzero.cocci index 8198cc84b4c..90fa0ddef65 100644 --- a/coccinelle/memzero.cocci +++ b/coccinelle/memzero.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression s; @@ diff --git a/coccinelle/mfree.cocci b/coccinelle/mfree.cocci index 1389cd35dbf..191cd626f52 100644 --- a/coccinelle/mfree.cocci +++ b/coccinelle/mfree.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression p; @@ diff --git a/coccinelle/mfree_return.cocci b/coccinelle/mfree_return.cocci index 15e6c7d566b..c2c4cb3209e 100644 --- a/coccinelle/mfree_return.cocci +++ b/coccinelle/mfree_return.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ /* Avoid running this transformation on the mfree function itself */ position p : script:python() { p[0].current_element != "mfree" }; diff --git a/coccinelle/no-if-assignments.cocci b/coccinelle/no-if-assignments.cocci index 9f63e903376..9fbc018f11a 100644 --- a/coccinelle/no-if-assignments.cocci +++ b/coccinelle/no-if-assignments.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression p, q; identifier r; diff --git a/coccinelle/not_in_set.cocci b/coccinelle/not_in_set.cocci index 3486cff5df1..0840109502a 100644 --- a/coccinelle/not_in_set.cocci +++ b/coccinelle/not_in_set.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* Limit the number of expressions to 6 for performance reasons */ @@ expression e; diff --git a/coccinelle/o-ndelay.cocci b/coccinelle/o-ndelay.cocci index 669424a0548..8b7a150243f 100644 --- a/coccinelle/o-ndelay.cocci +++ b/coccinelle/o-ndelay.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ @@ - O_NDELAY diff --git a/coccinelle/reallocarray.cocci b/coccinelle/reallocarray.cocci index 21fe9dfbfdf..85a8b3bc38d 100644 --- a/coccinelle/reallocarray.cocci +++ b/coccinelle/reallocarray.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression q, p, n, m; @@ diff --git a/coccinelle/redundant-if.cocci b/coccinelle/redundant-if.cocci index 515e36e1517..6582d6373b5 100644 --- a/coccinelle/redundant-if.cocci +++ b/coccinelle/redundant-if.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression r; @@ diff --git a/coccinelle/safe_close-no-if.cocci b/coccinelle/safe_close-no-if.cocci index 81c56785181..881ce1fa0a8 100644 --- a/coccinelle/safe_close-no-if.cocci +++ b/coccinelle/safe_close-no-if.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression fd; @@ diff --git a/coccinelle/safe_close.cocci b/coccinelle/safe_close.cocci index 6fedd804f2e..36a85372517 100644 --- a/coccinelle/safe_close.cocci +++ b/coccinelle/safe_close.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression fd; @@ diff --git a/coccinelle/safe_closedir.cocci b/coccinelle/safe_closedir.cocci index 743ffd97efb..8981825230e 100644 --- a/coccinelle/safe_closedir.cocci +++ b/coccinelle/safe_closedir.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression p; @@ diff --git a/coccinelle/safe_fclose.cocci b/coccinelle/safe_fclose.cocci index 6961cd01645..fc1b584d88f 100644 --- a/coccinelle/safe_fclose.cocci +++ b/coccinelle/safe_fclose.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression p; @@ diff --git a/coccinelle/sd_event_source_disable_unref.cocci b/coccinelle/sd_event_source_disable_unref.cocci index 2763fefac90..659aa00cf32 100644 --- a/coccinelle/sd_event_source_disable_unref.cocci +++ b/coccinelle/sd_event_source_disable_unref.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression p; @@ diff --git a/coccinelle/set_ensure_put.cocci b/coccinelle/set_ensure_put.cocci index 92d7970adea..cfcd77b7a16 100644 --- a/coccinelle/set_ensure_put.cocci +++ b/coccinelle/set_ensure_put.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ local idexpression r; expression p, k, x; diff --git a/coccinelle/strempty.cocci b/coccinelle/strempty.cocci index 0868184c5d4..d36f092f63a 100644 --- a/coccinelle/strempty.cocci +++ b/coccinelle/strempty.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ /* Avoid running this transformation on the strempty function itself and * on the "make_expression" macro in src/libsystemd/sd-bus/bus-convenience.c. diff --git a/coccinelle/strjoin.cocci b/coccinelle/strjoin.cocci index 46f70c4c236..1efff700b7b 100644 --- a/coccinelle/strjoin.cocci +++ b/coccinelle/strjoin.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ position p : script:python() { p[0].current_element != "test_strjoin" }; expression t; diff --git a/coccinelle/strjoina.cocci b/coccinelle/strjoina.cocci index b2096334805..891b22a2040 100644 --- a/coccinelle/strjoina.cocci +++ b/coccinelle/strjoina.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ position p : script:python() { p[0].current_element != "test_strjoina" }; expression n, m; diff --git a/coccinelle/strv_free.cocci b/coccinelle/strv_free.cocci index 0ad56f772f3..8eddfc566ed 100644 --- a/coccinelle/strv_free.cocci +++ b/coccinelle/strv_free.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression p; @@ diff --git a/coccinelle/swap-two.cocci b/coccinelle/swap-two.cocci index edf7d32403e..d80c4e0402f 100644 --- a/coccinelle/swap-two.cocci +++ b/coccinelle/swap-two.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression x, y, z; @@ diff --git a/coccinelle/synthetic-errno.cocci b/coccinelle/synthetic-errno.cocci index dcae069f748..6826ea45dad 100644 --- a/coccinelle/synthetic-errno.cocci +++ b/coccinelle/synthetic-errno.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ expression e; expression list args; diff --git a/coccinelle/take-fd.cocci b/coccinelle/take-fd.cocci index f7124e78965..396d6965c74 100644 --- a/coccinelle/take-fd.cocci +++ b/coccinelle/take-fd.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ local idexpression p; expression q; diff --git a/coccinelle/take-ptr.cocci b/coccinelle/take-ptr.cocci index 0cebe815759..3251d3ed65a 100644 --- a/coccinelle/take-ptr.cocci +++ b/coccinelle/take-ptr.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ local idexpression p; expression q; diff --git a/coccinelle/while-true.cocci b/coccinelle/while-true.cocci index c23fb11f223..3ea70bc0c61 100644 --- a/coccinelle/while-true.cocci +++ b/coccinelle/while-true.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ statement s; @@ diff --git a/coccinelle/xsprintf.cocci b/coccinelle/xsprintf.cocci index 660a35e3f4d..3b38090652e 100644 --- a/coccinelle/xsprintf.cocci +++ b/coccinelle/xsprintf.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ position p : script:python() { not p[0].file.startswith("man/") }; expression e, fmt; diff --git a/coccinelle/zz-drop-braces.cocci b/coccinelle/zz-drop-braces.cocci index 34bf12fbea7..8c3be01c1f7 100644 --- a/coccinelle/zz-drop-braces.cocci +++ b/coccinelle/zz-drop-braces.cocci @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ position p : script:python() { p[0].file != "src/journal/lookup3.c" }; identifier id;