Skip to content

Commit

Permalink
licensing: add spdx to our .cocci files
Browse files Browse the repository at this point in the history
Since those are chunks of code based on our codebase, it's easiest to use the
same license.
  • Loading branch information
keszybz committed Oct 1, 2021
1 parent ed77c2d commit 64b92d6
Show file tree
Hide file tree
Showing 52 changed files with 54 additions and 1 deletion.
1 change: 1 addition & 0 deletions coccinelle/bool-cast.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
bool b;
expression y;
Expand Down
1 change: 1 addition & 0 deletions coccinelle/close-above-stdio.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression fd;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/cmp.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression x, y;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/const-strlen.disabled
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
constant s;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/debug-logging.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
@@
(
Expand Down
1 change: 1 addition & 0 deletions coccinelle/div-round-up.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression x, y;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/dup-fcntl.cocci
Original file line number Diff line number Diff line change
@@ -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" };
Expand Down
1 change: 1 addition & 0 deletions coccinelle/empty-or-dash.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression s;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/empty-or-root.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression s;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/empty-to-null.cocci
Original file line number Diff line number Diff line change
@@ -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" };
Expand Down
1 change: 1 addition & 0 deletions coccinelle/empty-to-root.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression s;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/enotsup.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
@@
- ENOTSUP
Expand Down
1 change: 1 addition & 0 deletions coccinelle/equals-null.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression e;
statement s;
Expand Down
1 change: 1 addition & 0 deletions coccinelle/errno-check.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
constant c;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/errno.cocci
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 1 addition & 0 deletions coccinelle/exit-0.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
@@
- exit(0);
Expand Down
1 change: 1 addition & 0 deletions coccinelle/flags-set.cocci
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions coccinelle/fopen-unlocked.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression f, path, options;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/free_and_replace.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression p, q;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/hashmap_free.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression p;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/htonl.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression s;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/in_set.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Limit the number of expressions to 6 for performance reasons */
@@
expression e;
Expand Down
1 change: 1 addition & 0 deletions coccinelle/iovec-make.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression x, y, p, l;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/isempty.cocci
Original file line number Diff line number Diff line change
@@ -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" };
Expand Down
1 change: 1 addition & 0 deletions coccinelle/log-json.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression e, v, flags;
expression list args;
Expand Down
4 changes: 3 additions & 1 deletion coccinelle/macros.h
Original file line number Diff line number Diff line change
@@ -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)
*/
Expand Down
1 change: 1 addition & 0 deletions coccinelle/malloc_multiply.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression q, n, m;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/memzero.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression s;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/mfree.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression p;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/mfree_return.cocci
Original file line number Diff line number Diff line change
@@ -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" };
Expand Down
1 change: 1 addition & 0 deletions coccinelle/no-if-assignments.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression p, q;
identifier r;
Expand Down
1 change: 1 addition & 0 deletions coccinelle/not_in_set.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Limit the number of expressions to 6 for performance reasons */
@@
expression e;
Expand Down
1 change: 1 addition & 0 deletions coccinelle/o-ndelay.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
@@
- O_NDELAY
Expand Down
1 change: 1 addition & 0 deletions coccinelle/reallocarray.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression q, p, n, m;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/redundant-if.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression r;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/safe_close-no-if.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression fd;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/safe_close.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression fd;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/safe_closedir.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression p;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/safe_fclose.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression p;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/sd_event_source_disable_unref.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression p;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/set_ensure_put.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
local idexpression r;
expression p, k, x;
Expand Down
1 change: 1 addition & 0 deletions coccinelle/strempty.cocci
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
1 change: 1 addition & 0 deletions coccinelle/strjoin.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
position p : script:python() { p[0].current_element != "test_strjoin" };
expression t;
Expand Down
1 change: 1 addition & 0 deletions coccinelle/strjoina.cocci
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 1 addition & 0 deletions coccinelle/strv_free.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression p;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/swap-two.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression x, y, z;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/synthetic-errno.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression e;
expression list args;
Expand Down
1 change: 1 addition & 0 deletions coccinelle/take-fd.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
local idexpression p;
expression q;
Expand Down
1 change: 1 addition & 0 deletions coccinelle/take-ptr.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
local idexpression p;
expression q;
Expand Down
1 change: 1 addition & 0 deletions coccinelle/while-true.cocci
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
statement s;
@@
Expand Down
1 change: 1 addition & 0 deletions coccinelle/xsprintf.cocci
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 1 addition & 0 deletions coccinelle/zz-drop-braces.cocci
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 64b92d6

Please sign in to comment.