mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
checkpatch: forbid filesystem accesses from within the kernel.
Use of the sys_open/close/read/write system calls from within kernel code is inappropriate, and now triggers errors. Change-Id: I98e20513c257d0664684b7144585853f617d771a Signed-off-by: Gregory Bean <gbean@codeaurora.org> (cherry picked from commit ee62f2afcac1bcb180b2f0dddf2c8f5cda54bc5b)
This commit is contained in:
parent
d0d4b63246
commit
5bc97df95b
1 changed files with 6 additions and 0 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue