path: root/scripts
diff options
authorGuenter Roeck <>2021-06-30 18:56:25 -0700
committerLinus Torvalds <>2021-07-01 11:06:06 -0700
commit46b85bf96714267ab7855683b40103c9282aaf4e (patch)
tree0eb9207cde9c9f0f9e952cf1bb324dbc0d55f77d /scripts
parent690786511b32baba073f729844779172d2ed72b6 (diff)
checkpatch: do not complain about positive return values starting with EPOLL
checkpatch complains about positive return values of poll functions. Example: WARNING: return of an errno should typically be negative (ie: return -EPOLLIN) + return EPOLLIN; Poll functions return positive values. The defines for the return values of poll functions all start with EPOLL, resulting in a number of false positives. An often used workaround is to assign poll function return values to variables and returning that variable, but that is a less than perfect solution. There is no error definition which starts with EPOLL, so it is safe to omit the warning for return values starting with EPOLL. Link: Signed-off-by: Guenter Roeck <> Acked-by: Joe Perches <> Cc: Ricardo Ribalda <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'scripts')
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/ b/scripts/
index dad87c368632..461d4221e4a4 100755
--- a/scripts/
+++ b/scripts/
@@ -5462,7 +5462,7 @@ sub process {
# Return of what appears to be an errno should normally be negative
if ($sline =~ /\breturn(?:\s*\(+\s*|\s+)(E[A-Z]+)(?:\s*\)+\s*|\s*)[;:,]/) {
my $name = $1;
- if ($name ne 'EOF' && $name ne 'ERROR') {
+ if ($name ne 'EOF' && $name ne 'ERROR' && $name !~ /^EPOLL/) {
"return of an errno should typically be negative (ie: return -$1)\n" . $herecurr);