diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 987ae07ba484..c711437ace1e 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4479,6 +4479,13 @@ sub process { "Concatenated strings should use spaces between elements\n" . $herecurr); } +# sys_open/read/write/close are not allowed in the kernel + if ($line =~ /\b(sys_(?:open|read|write|close))\b/) { + ERROR("FILE_OPS", + "$1 is inappropriate in kernel code.\n" . + $herecurr); + } + # warn about #if 0 if ($line =~ /^.\s*\#\s*if\s+0\b/) { WARN("IF_0",