Check for a few common errors in Blackfin-specific code wrt MMR loading in assembly and doing core/system syncs. Restrict the Blackfin MMR checks to actual Blackfin assembly files as pointed out by Joe Perches. Signed-off-by: Mike Frysinger <[email protected]> CC: Bryan Wu <[email protected]> CC: Andy Whitcroft <[email protected]> --- scripts/checkpatch.pl | 22 ++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index dae7d30..ead9675 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -486,9 +486,31 @@ sub process { WARN("line over 80 characters\n" . $herecurr); } +# Blackfin: use hi/lo macros + if ($realfile =~ s@arch/blackfin/.*\.S$@) { + if ($line =~ /\.[lL][[:space:]]*=.*&[[:space:]]*0x[fF][fF][fF][fF]/) { + my $herevet = "$here\n" . cat_vet($line) . "\n"; + ERROR("use the LO() macro, not (... & 0xFFFF)\n" . $herevet); + } + if ($line =~ /\.[hH][[:space:]]*=.*>>[[:space:]]*16/) { + my $herevet = "$here\n" . cat_vet($line) . "\n"; + ERROR("use the HI() macro, not (... >> 16)\n" . $herevet); + } + } + # check we are in a valid source file *.[hc] if not then ignore this hunk next if ($realfile !~ /\.[hc]$/); +# Blackfin: don't use __builtin_bfin_[cs]sync + if ($line =~ /__builtin_bfin_csync/) { + my $herevet = "$here\n" . cat_vet($line) . "\n"; + ERROR("use the CSYNC() macro in asm/blackfin.h\n" . $herevet); + } + if ($line =~ /__builtin_bfin_ssync/) { + my $herevet = "$here\n" . cat_vet($line) . "\n"; + ERROR("use the SSYNC() macro in asm/blackfin.h\n" . $herevet); + } + # at the beginning of a line any tabs must come first and anything # more than 8 must use tabs. if ($line=~/^\+\s* \t\s*\S/ or $line=~/^\+\s* \s*/) { -- 1.5.3.rc5
Attachment:
signature.asc
Description: This is a digitally signed message part.
- References:
- [patch] add some Blackfin specific checks to checkpatch.pl
- From: Mike Frysinger <[email protected]>
- [patch] add some Blackfin specific checks to checkpatch.pl
- Prev by Date: Re: [PATCH 11/23] make atomic_read() and atomic_set() behavior consistent on m32r
- Next by Date: [PATCH] get_nodes should ignore invalid node
- Previous by thread: [patch] add some Blackfin specific checks to checkpatch.pl
- Next by thread: Re: [patch] add some Blackfin specific checks to checkpatch.pl
- Index(es):