* [PATCH] checkpatch: add some common Blackfin checks
@ 2009-05-26 23:37 Mike Frysinger
2009-09-14 3:41 ` Mike Frysinger
0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2009-05-26 23:37 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-kbuild, uclinux-dist-devel, Bryan Wu, Andy Whitcroft
Add checks for Blackfin-specific issues that seem to crop up from time to
time. In particular, we have helper macros to break a 32bit address into
the hi/lo parts, and we want to make sure people use the csync/ssync
variant that includes fun anomaly workarounds.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
CC: Andy Whitcroft <apw@shadowen.org>
---
scripts/checkpatch.pl | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2d5ece7..2b1852c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1336,6 +1336,18 @@ sub process {
WARN("adding a line without newline at end of file\n" . $herecurr);
}
+# Blackfin: use hi/lo macros
+ if ($realfile =~ m@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 C or perl if not then ignore this hunk
next if ($realfile !~ /\.(h|c|pl)$/);
@@ -1355,6 +1367,16 @@ sub process {
WARN("CVS style keyword markers, these will _not_ be updated\n". $herecurr);
}
+# 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);
+ }
+
# Check for potential 'bare' types
my ($stat, $cond, $line_nr_next, $remain_next, $off_next);
if ($realcnt && $line =~ /.\s*\S/) {
--
1.6.3.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] checkpatch: add some common Blackfin checks
2009-05-26 23:37 [PATCH] checkpatch: add some common Blackfin checks Mike Frysinger
@ 2009-09-14 3:41 ` Mike Frysinger
0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2009-09-14 3:41 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, linux-kbuild, uclinux-dist-devel, Bryan Wu, Andy Whitcroft
On Tue, May 26, 2009 at 19:37, Mike Frysinger wrote:
> Add checks for Blackfin-specific issues that seem to crop up from time to
> time. In particular, we have helper macros to break a 32bit address into
> the hi/lo parts, and we want to make sure people use the csync/ssync
> variant that includes fun anomaly workarounds.
Andrew: could you pick this up ?
-mike
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-14 3:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-26 23:37 [PATCH] checkpatch: add some common Blackfin checks Mike Frysinger
2009-09-14 3:41 ` Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®