diff options
author | Nishanth Menon <nm@ti.com> | 2013-02-27 20:02:46 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-27 22:10:09 -0500 |
commit | 9dc30918b23f4b0d7f7f81be5bda023aea3f6627 (patch) | |
tree | a490b631fee355c9c2262ecb3c892b9d1f8ef0ad /scripts | |
parent | ff6a6da60b894d008f704fbeb5bc596f9994b16e (diff) |
scripts/kernel-doc: handle struct member __aligned without numbers
Commit ef5da59f1260 ("scripts/kernel-doc: handle struct member
__aligned") permits "char something [123] __aligned(8);".
However, by using \d we constraint ourselves with integers. This is not
always the case. In fact, it might be better to do char something[123]
__aligned(sizeof(u16));
For example, With wireless_dev defining:
u8 address[ETH_ALEN] __aligned(sizeof(u16));
With \d, scripts/kernel-doc erroneously says:
Warning(include/net/cfg80211.h:2618): Excess struct/union/enum/typedef member 'address' description in 'wireless_dev'
This is because the regex __aligned\s*\(\d+\) fails match at \d as
sizeof is used.
So replace \d with . to indicate "something" in kernel-doc to ignore
__aligned(SOMETHING) in structs. With this change, we can use integers
OR sizeof() or macros as we please.
Signed-off-by: Nishanth Menon <nm@ti.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Johannes Berg <johannes.berg@intel.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>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/kernel-doc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index f565536a2bef..4305b2f2ec5e 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -1750,7 +1750,7 @@ sub dump_struct($$) { | |||
1750 | # strip kmemcheck_bitfield_{begin,end}.*; | 1750 | # strip kmemcheck_bitfield_{begin,end}.*; |
1751 | $members =~ s/kmemcheck_bitfield_.*?;//gos; | 1751 | $members =~ s/kmemcheck_bitfield_.*?;//gos; |
1752 | # strip attributes | 1752 | # strip attributes |
1753 | $members =~ s/__aligned\s*\(\d+\)//gos; | 1753 | $members =~ s/__aligned\s*\(.+\)//gos; |
1754 | 1754 | ||
1755 | create_parameterlist($members, ';', $file); | 1755 | create_parameterlist($members, ';', $file); |
1756 | check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested); | 1756 | check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested); |