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: 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 051ccb9417..a3311f0659 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 44b3b1c9f1..93a0a85978 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 a34cbe5bf6..d5ab0f245e 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 30a6e5a88e..8b1a635274 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 a679dab011..2885350f85 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 a0c6df9801..609ec879d3 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 8b133b3a24..2c87f70dc3 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 bebaead2ff..56246affaa 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 bf2f614da6..d36f0c8b1b 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 bc6c656e79..1cc89475a6 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 3720497bef..9a65a6936f 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 c65734d382..47ac4b748b 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 3fce0f4caa..92c7054013 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 709cb4ace6..f6f0071cd1 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 4e594e7826..dd886ea493 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 8b81600579..ff3d965a9d 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 22620f1849..bcf08db23b 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 7870f8ccea..1caa698c7b 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 9dcdbf4d42..7d8b6a738c 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 86b9542488..31e1279ac0 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 4e69bb7090..c247d24e9b 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 1c17c7df1f..8be786dc2d 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 7a0d4ced9b..79116882fc 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 e0a9f07ca6..b1b9277270 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 3730fd6ea3..d184e56584 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 62177f0d86..0be4aaea42 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 3284edf737..320d257bd9 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 8198cc84b4..90fa0ddef6 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 1389cd35db..191cd626f5 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 15e6c7d566..c2c4cb3209 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 9f63e90337..9fbc018f11 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 3486cff5df..0840109502 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 669424a054..8b7a150243 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 21fe9dfbfd..85a8b3bc38 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 515e36e151..6582d6373b 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 81c5678518..881ce1fa0a 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 6fedd804f2..36a8537251 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 743ffd97ef..8981825230 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 6961cd0164..fc1b584d88 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 2763fefac9..659aa00cf3 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 92d7970ade..cfcd77b7a1 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 0868184c5d..d36f092f63 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 46f70c4c23..1efff700b7 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 b209633480..891b22a204 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 0ad56f772f..8eddfc566e 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 edf7d32403..d80c4e0402 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 dcae069f74..6826ea45da 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 f7124e7896..396d6965c7 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 0cebe81575..3251d3ed65 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 c23fb11f22..3ea70bc0c6 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 660a35e3f4..3b38090652 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 34bf12fbea..8c3be01c1f 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; -- cgit v1.2.1