Skip to content

Commit

Permalink
checkpatch: correct diagnostic for ENOSYS use
Browse files Browse the repository at this point in the history
The rationale is for Linux; use the rationale for Zephyr.

See zephyrproject-rtos#23727

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
  • Loading branch information
pabigot committed Mar 23, 2021
1 parent c1f7b9f commit d99bf6f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4255,12 +4255,11 @@ sub process {
"Prefer dev_$level(... to dev_printk(KERN_$orig, ...\n" . $herecurr);
}

# ENOSYS means "bad syscall nr" and nothing else. This will have a small
# number of false positives, but assembly files are not checked, so at
# least the arch entry code will not trigger this warning.
# Zephyr uses ENOTSUP for cases where ENOTSUP or ENOSYS would be more appropriate;
# See: https://github.com/zephyrproject-rtos/zephyr/issues/23727
if ($line =~ /\bENOSYS\b/) {
WARN("ENOSYS",
"ENOSYS means 'invalid syscall nr' and nothing else\n" . $herecurr);
"Use ENOTSUP instead of ENOSYS in Zephyr API\n" . $herecurr);
}

# ENOTSUPP is not a standard error code and should be avoided in new patches.
Expand Down

0 comments on commit d99bf6f

Please sign in to comment.