History

checkpatch.pl: new instances of ENOSYS are errors

ENOSYS means that a nonexistent system call was called. We have a bad habit of using it for things like invalid operations on otherwise valid syscalls. We should avoid this in new code. Pervasive incorrect usage of ENOSYS came up at the kernel summit ABI review discussion. Let's see if checkpatch can help. I'll submit a separate patch for include/uapi/asm-generic/errno.h.

Andy Lutomirski committed 11 years ago

Commit 91c9afa1 parent c17893c1 file · +8 −0Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+8−0
@@ -3396,6 +3396,14 @@ sub process { · 3395 unmodified lines
33963396 "Prefer dev_$level(... to dev_printk(KERN_$orig, ...\n" . $herecurr);
33973397 }
33983398
3399+# ENOSYS means "bad syscall nr" and nothing else. This will have a small
3400+# number of false positives, but assembly files are not checked, so at
3401+# least the arch entry code will not trigger this warning.
3402+ if ($line =~ /\bENOSYS\b/) {
3403+ WARN("ENOSYS",
3404+ "ENOSYS means 'invalid syscall nr' and nothing else\n" . $herecurr);
3405+ }
3406+
33993407 # function brace can't be on same line, except for #defines of do while,
34003408 # or if closed on same line
34013409 if (($line=~/$Type\s*$Ident\(.*\).*\s*{/) and

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t