kernel-doc: restrict syntax for private: and public:
scripts/kernel-doc can (incorrectly) delete struct members that are surrounded by /* ... */ <struct members> /* ... */ if there is a /* private: */ comment in there somewhere also. Fix that by making the "/* private:" only allow whitespace between /* and "private:", not anything/everything in the world. This fixes some erroneous kernel-doc warnings that popped up while processing include/linux/usb/composite.h. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
00a62ce91e
commit
52dc5aec9f
@ -269,7 +269,10 @@ Use the argument mechanism to document members or constants.
|
|||||||
|
|
||||||
Inside a struct description, you can use the "private:" and "public:"
|
Inside a struct description, you can use the "private:" and "public:"
|
||||||
comment tags. Structure fields that are inside a "private:" area
|
comment tags. Structure fields that are inside a "private:" area
|
||||||
are not listed in the generated output documentation.
|
are not listed in the generated output documentation. The "private:"
|
||||||
|
and "public:" tags must begin immediately following a "/*" comment
|
||||||
|
marker. They may optionally include comments between the ":" and the
|
||||||
|
ending "*/" marker.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
@ -283,7 +286,7 @@ Example:
|
|||||||
struct my_struct {
|
struct my_struct {
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
/* private: */
|
/* private: internal use only */
|
||||||
int c;
|
int c;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1411,7 +1411,8 @@ sub dump_struct($$) {
|
|||||||
my $file = shift;
|
my $file = shift;
|
||||||
my $nested;
|
my $nested;
|
||||||
|
|
||||||
if ($x =~/(struct|union)\s+(\w+)\s*{(.*)}/) {
|
if ($x =~ /(struct|union)\s+(\w+)\s*{(.*)}/) {
|
||||||
|
#my $decl_type = $1;
|
||||||
$declaration_name = $2;
|
$declaration_name = $2;
|
||||||
my $members = $3;
|
my $members = $3;
|
||||||
|
|
||||||
@ -1420,8 +1421,8 @@ sub dump_struct($$) {
|
|||||||
$nested = $1;
|
$nested = $1;
|
||||||
|
|
||||||
# ignore members marked private:
|
# ignore members marked private:
|
||||||
$members =~ s/\/\*.*?private:.*?public:.*?\*\///gos;
|
$members =~ s/\/\*\s*private:.*?\/\*\s*public:.*?\*\///gos;
|
||||||
$members =~ s/\/\*.*?private:.*//gos;
|
$members =~ s/\/\*\s*private:.*//gos;
|
||||||
# strip comments:
|
# strip comments:
|
||||||
$members =~ s/\/\*.*?\*\///gos;
|
$members =~ s/\/\*.*?\*\///gos;
|
||||||
$nested =~ s/\/\*.*?\*\///gos;
|
$nested =~ s/\/\*.*?\*\///gos;
|
||||||
|
Loading…
Reference in New Issue
Block a user