summaryrefslogtreecommitdiffstats
path: root/coccinelle
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2020-11-19 18:34:48 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2020-11-19 18:57:26 +0100
commita61c0bdf3915495436b36e55e02a1614f6a22cb6 (patch)
treeb3d446e3d88ab69202b766953bd7f4d92bd27abf /coccinelle
parentseccomp: move brk+mmap+mmap2 into @default syscall filter set (diff)
downloadsystemd-a61c0bdf3915495436b36e55e02a1614f6a22cb6.tar.xz
systemd-a61c0bdf3915495436b36e55e02a1614f6a22cb6.zip
coccinelle: add one more rule to use return value of log_xxx_errno()
Diffstat (limited to 'coccinelle')
-rw-r--r--coccinelle/errno.cocci9
1 files changed, 9 insertions, 0 deletions
diff --git a/coccinelle/errno.cocci b/coccinelle/errno.cocci
index ed74c0a98a..c928266481 100644
--- a/coccinelle/errno.cocci
+++ b/coccinelle/errno.cocci
@@ -30,3 +30,12 @@ expression e;
+ return
log_LEVEL_errno(e, ...);
- return -e;
+@@
+identifier log_LEVEL_errno =~ "^log_(debug|info|notice|warning|error|emergency)_errno$";
+expression list args;
+expression e;
+local idexpression r;
+@@
+- log_LEVEL_errno(e, args);
+- r = e;
++ r = log_LEVEL_errno(e, args);