diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 166552fd29e..9d8b66f6a74 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3219,6 +3219,12 @@ sub process { "Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr); } +# sys_open/read/write/close are not allowed in the kernel + if ($line =~ /\b(sys_(?:open|read|write|close))\b/) { + ERROR("$1 is inappropriate in kernel code.\n" . + $herecurr); + } + # warn about #if 0 if ($line =~ /^.\s*\#\s*if\s+0\b/) { WARN("if this code is redundant consider removing it\n"