diff options
author | 2017-12-08 20:52:38 +0100 | |
---|---|---|
committer | 2017-12-11 16:05:40 +0100 | |
commit | 234519ae6d6821ae5e83bcddb211905ef4de5700 (patch) | |
tree | 5335ad6ea093f0829bb871c2cbf83b354e53d402 /coccinelle | |
parent | resolved: fix wrong error code (#7601) (diff) | |
download | systemd-234519ae6d6821ae5e83bcddb211905ef4de5700.tar.gz systemd-234519ae6d6821ae5e83bcddb211905ef4de5700.tar.bz2 systemd-234519ae6d6821ae5e83bcddb211905ef4de5700.zip |
tree-wide: drop a few == NULL and != NULL comparison
Our CODING_STYLE suggests not comparing with NULL, but relying on C's
downgrade-to-bool feature for that. Fix up some code to match these
guidelines. (This is not comprehensive, the coccinelle output for this
is unfortunately kinda borked)
Diffstat (limited to 'coccinelle')
-rw-r--r-- | coccinelle/equals-null.cocci | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/coccinelle/equals-null.cocci b/coccinelle/equals-null.cocci new file mode 100644 index 000000000..957d828a8 --- /dev/null +++ b/coccinelle/equals-null.cocci @@ -0,0 +1,14 @@ +@@ +expression e; +statement s; +@@ +- if (e == NULL) ++ if (!e) +s +@@ +expression e; +statement s; +@@ +- if (e != NULL) ++ if (e) +s |