Commit 8b65e97d8226dd8c54384f966a5d2cb7e8216ec6

Authored by Johannes Berg
Committed by Greg Kroah-Hartman
1 parent 83d17827a7

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

commit 7b990789a4c3420fa57596b368733158e432d444 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: 9dc30918b23f ("scripts/kernel-doc: handle struct member __aligned without numbers")
Signed-off-by: Johannes 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -1753,7 +1753,7 @@
1753 1753 # strip kmemcheck_bitfield_{begin,end}.*;
1754 1754 $members =~ s/kmemcheck_bitfield_.*?;//gos;
1755 1755 # strip attributes
1756   - $members =~ s/__aligned\s*\(.+\)//gos;
  1756 + $members =~ s/__aligned\s*\([^;]*\)//gos;
1757 1757  
1758 1758 create_parameterlist($members, ';', $file);
1759 1759 check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested);