summaryrefslogtreecommitdiffstats
path: root/coccinelle
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-06-28 18:37:34 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-07-02 12:46:16 +0200
commit64903d18dfd0344d5af3c0f8006b2e220de90091 (patch)
treef6ed4047b5d324adb513115fc9315ce25aaec5af /coccinelle
parentMerge pull request #23827 from yuwata/sd-event-process-buffered-inotify-data (diff)
downloadsystemd-64903d18dfd0344d5af3c0f8006b2e220de90091.tar.xz
systemd-64903d18dfd0344d5af3c0f8006b2e220de90091.zip
basic/list: drop LIST_IS_EMPTY
This was a trivial wrapper that didn't provide any added value. With more complicated structures like strvs, hashmaps, sets, and arrays, it is possible to have an empty container. But in case of a list, the list is empty only when the head is missing. Also, we generally want the positive condition, so we replace many if (!LIST_IS_EMPTY(x)) with just if (x).
Diffstat (limited to 'coccinelle')
-rw-r--r--coccinelle/macros.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/coccinelle/macros.h b/coccinelle/macros.h
index 6a0a64bb05..f44b3f2d26 100644
--- a/coccinelle/macros.h
+++ b/coccinelle/macros.h
@@ -189,8 +189,6 @@
(i) != (p); \
(i) = (i)->name##_next ? (i)->name##_next : (head))
-#define LIST_IS_EMPTY(head) \
- (!(head))
#define LIST_JOIN(name,a,b) \
do { \
assert(b); \