diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-11-19 18:34:48 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-11-19 18:57:26 +0100 |
commit | a61c0bdf3915495436b36e55e02a1614f6a22cb6 (patch) | |
tree | b3d446e3d88ab69202b766953bd7f4d92bd27abf /coccinelle | |
parent | seccomp: move brk+mmap+mmap2 into @default syscall filter set (diff) | |
download | systemd-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.cocci | 9 |
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); |