lkml.org 
[lkml]   [2016]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH 2/2] staging: slicoss: fix missing blank line (fwd)
From
Date
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);

\
 
 \ /
  Last update: 2016-04-06 08:41    [W:0.087 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site