* Re: [PATCH 2/2] staging: slicoss: fix missing blank line (fwd)
[not found] <alpine.DEB.2.02.1604060716280.2210@localhost6.localdomain6>
@ 2016-04-06 6:29 ` Joe Perches
0 siblings, 0 replies; only message in thread
From: Joe Perches @ 2016-04-06 6:29 UTC (permalink / raw)
To: Julia Lawall; +Cc: LKML, Andrew Morton
On Wed, 2016-04-06 at 07:17 +0200, Julia Lawall wrote:
> I have the impression that __iomem is in the wrong place in the following
> code. Perhaps checkpatch could do something about that? Coccinelle,
> unfortunately, skips over such annotations, to simplify parsing...
[]
> __iomem struct slic_regs *slic_regs = adapter->slic_regs;
Maybe so.
There aren't many of these in the kernel tree.
$ git grep -E "^\s+__iomem" | wc -l
46
And there are a whole lot more after the type,
so maybe this is appropriate.
---
scripts/checkpatch.pl | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e3d9c34..1b23495 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3400,6 +3400,14 @@ sub process {
}
}
+# check for attributions like __iomem before the type
+ while ($sline =~ m{(\b$Type\s*$Ident)}g) {
+ my $tmp = trim($1);
+ next if ($tmp !~ /^($Sparse)\b/);
+ WARN("ATTRIBUTE_LOCATION",
+ "attribute '$1' should be positioned after the type\n" . $herecurr);
+ }
+
# check for misordered declarations of char/short/int/long with signed/unsigned
while ($sline =~ m{(\b$TypeMisordered\b)}g) {
my $tmp = trim($1);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-04-06 6:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <alpine.DEB.2.02.1604060716280.2210@localhost6.localdomain6>
2016-04-06 6:29 ` [PATCH 2/2] staging: slicoss: fix missing blank line (fwd) Joe Perches
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®