lkml.org 
[lkml]   [2019]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] checkpatch: Don't warn about returning EPOLL* defines
Date
The EPOLL* defines are bit definitions, not errno values, so they should
be returned as-is, not as negative values.

Signed-off-by: Ben Shelton <benjamin.h.shelton@intel.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
---
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 592911a..caad932 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4867,7 +4867,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*)[;:,]/) {
+ if ($sline =~ /\breturn(?:\s*\(+\s*|\s+)(E(?!POLL)[A-Z]+)(?:\s*\)+\s*|\s*)[;:,]/) {
my $name = $1;
if ($name ne 'EOF' && $name ne 'ERROR') {
WARN("USE_NEGATIVE_ERRNO",
--
2.6.4
\
 
 \ /
  Last update: 2019-12-03 19:01    [W:0.021 / U:1.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site