Skip to contentSkip to conversation

checkpatch-do-not-complain-about-positive-return-values-starting-with-epoll.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jul 6, 2021

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: checkpatch: do not complain about positive return values starting with EPOLL
has been removed from the -mm tree. Its filename was
checkpatch-do-not-complain-about-positive-return-values-starting-with-epoll.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Guenter Roeck <[email protected]>
Subject: 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.

---

 scripts/checkpatch.pl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl renamed from scripts/checkpatch.pl~checkpatch-do-not-complain-about-positive-return-values-starting-with-epoll +1 -1
@@ -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/) {
 				WARN("USE_NEGATIVE_ERRNO",
 				     "return of an errno should typically be negative (ie: return -$1)\n" . $herecurr);
 			}

_

Patches currently in -mm which might be from [email protected] are