mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	bryan.wu@analog.com, apw@shadowen.org
Subject: [patch] add some Blackfin specific checks to checkpatch.pl
Date: Tue, 21 Aug 2007 18:29:59 -0400	[thread overview]
Message-ID: <200708211829.59975.vapier@gentoo.org> (raw)

Check for a few common errors in Blackfin-specific code wrt MMR loading in
assembly and doing core/system syncs.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Bryan Wu <bryan.wu@analog.com>
CC: Andy Whitcroft <apw@shadowen.org>
---
 scripts/checkpatch.pl |   20 ++++++++++++++++++++
 1 files changed, 20 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,29 @@ sub process {
 			WARN("line over 80 characters\n" . $herecurr);
 		}
 
+# Blackfin: use hi/lo macros
+		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

             reply	other threads:[~2007-08-21 22:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-21 22:29 Mike Frysinger [this message]
2007-08-22  2:15 ` Mike Frysinger
2007-09-13 11:55 ` Andy Whitcroft
2007-09-13 15:33   ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200708211829.59975.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=akpm@linux-foundation.org \
    --cc=apw@shadowen.org \
    --cc=bryan.wu@analog.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome