mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
checkpatch: forbid implied-barrier I/O functions.
Forbid read[bwl], write[bwl], in[bwl], and out[bwl], as they contain a 'stealth barrier' which can harm performance. Developers are expected to call appropriate __raw_* or *_relaxed APIs and manage barriers explicitly. Change-Id: Ie4da221c91a0505917199db9e2fdb704c3e47d44 Signed-off-by: Gregory Bean <gbean@codeaurora.org> (cherry picked from commit 032fd4ba09e195d9913c08f460130da9905936ef)
This commit is contained in:
parent
20a44b003b
commit
55bb2c050a
1 changed files with 18 additions and 0 deletions
|
@ -3254,6 +3254,24 @@ sub process {
|
|||
$herecurr);
|
||||
}
|
||||
|
||||
# read[bwl] & write[bwl] use too many barriers, use the _relaxed variants
|
||||
if ($line =~ /\b((?:read|write)[bwl])\b/) {
|
||||
ERROR("Use of $1 is deprecated: use $1_relaxed\n\t" .
|
||||
"with appropriate memory barriers instead.\n" .
|
||||
$herecurr);
|
||||
}
|
||||
|
||||
# likewise, in/out[bwl] should be __raw_read/write[bwl]...
|
||||
if ($line =~ /\b((in|out)([bwl]))\b/) {
|
||||
my ($all, $pref, $suf) = ($1, $2, $3);
|
||||
$pref =~ s/in/read/;
|
||||
$pref =~ s/out/write/;
|
||||
ERROR("Use of $all is deprecated: use " .
|
||||
"__raw_$pref$suf\n\t" .
|
||||
"with appropriate memory barriers instead.\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