Commit 9b9e842b authored by Johannes Berg's avatar Johannes Berg Committed by Luis Henriques

scripts/kernel-doc: don't eat struct members with __aligned

commit 7b990789 upstream.

The change from \d+ to .+ inside __aligned() means that the following
structure:

  struct test {
        u8 a __aligned(2);
        u8 b __aligned(2);
  };

essentially gets modified to

  struct test {
        u8 a;
  };

for purposes of kernel-doc, thus dropping a struct member, which in
turns causes warnings and invalid kernel-doc generation.

Fix this by replacing the catch-all (".") with anything that's not a
semicolon ("[^;]").

Fixes: 9dc30918 ("scripts/kernel-doc: handle struct member __aligned without numbers")
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 6fb6cef4
...@@ -1753,7 +1753,7 @@ sub dump_struct($$) { ...@@ -1753,7 +1753,7 @@ sub dump_struct($$) {
# strip kmemcheck_bitfield_{begin,end}.*; # strip kmemcheck_bitfield_{begin,end}.*;
$members =~ s/kmemcheck_bitfield_.*?;//gos; $members =~ s/kmemcheck_bitfield_.*?;//gos;
# strip attributes # strip attributes
$members =~ s/__aligned\s*\(.+\)//gos; $members =~ s/__aligned\s*\([^;]*\)//gos;
create_parameterlist($members, ';', $file); create_parameterlist($members, ';', $file);
check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested); check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment