checkpatch: exclude lib/posix/*.c from negative errno rule
The `USE_NEGATIVE_ERRNO` rule consistently generates false positives when working with certain areas of POSIX. It makes sense to disable this check for the POSIX API rather than requiring merge superpowers constantly. That way, we can merge as per usual after sufficient approvals rather than waiting for someone with merge superpowers to override / manually merge. Signed-off-by: Christopher Friedt <cfriedt@meta.com>
This commit is contained in:
parent
1f8d2e492e
commit
6e27b7d566
|
@ -5014,8 +5014,11 @@ sub process {
|
|||
if ($sline =~ /\breturn(?:\s*\(+\s*|\s+)(E[A-Z]+)(?:\s*\)+\s*|\s*)[;:,]/) {
|
||||
my $name = $1;
|
||||
if ($name ne 'EOF' && $name ne 'ERROR') {
|
||||
WARN("USE_NEGATIVE_ERRNO",
|
||||
"return of an errno should typically be negative (ie: return -$1)\n" . $herecurr);
|
||||
# only print this warning if not dealing with 'lib/posix/*.c'
|
||||
if ($realfile =~ /.*\/lib\/posix\/*.c/) {
|
||||
WARN("USE_NEGATIVE_ERRNO",
|
||||
"return of an errno should typically be negative (ie: return -$1)\n" . $herecurr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue