mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kernel-doc: handle spaces in array size
@ 2007-04-06 18:47 Randy Dunlap
  2007-04-06 19:24 ` Jan Engelhardt
  0 siblings, 1 reply; 8+ messages in thread
From: Randy Dunlap @ 2007-04-06 18:47 UTC (permalink / raw)
  To: lkml; +Cc: akpm

From: Randy Dunlap <randy.dunlap@oracle.com>

Unfortunately, kernel-doc has problems with a struct field like this:
	uint8_t databuf[NAND_MAX_PAGESIZE + NAND_MAX_OOBSIZE];

simply due to the spaces around the "+" sign, so drop all spaces inside
[...] so that parsing is done correctly (in some sense).

Warning(linux-2.6.20-git15/include/linux/mtd/nand.h:304): No description found for parameter 'NAND_MAX_OOBSIZE]'

This needs to sit in -mm for awhile to see if it has any adverse effects.

And yes, this is just a hack until kernel-doc learns to do better
parsing.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 scripts/kernel-doc |    6 ++++++
 1 file changed, 6 insertions(+)

--- linux-2.6.21-rc6.orig/scripts/kernel-doc
+++ linux-2.6.21-rc6/scripts/kernel-doc
@@ -1452,6 +1452,12 @@ sub create_parameterlist($$$) {
 	    $arg =~ s/\s*:\s*/:/g;
 	    $arg =~ s/\s*\[/\[/g;
 
+	    # no spaces inside [array size expression];
+	    # messes up split/pop/shift/unshift below;
+	    while ($arg =~ m/\[.*\s.*\]/) {
+		$arg =~ s/\[(.*)\s(.*)\]/\[$1$2\]/;
+	    }
+
 	    my @args = split('\s*,\s*', $arg);
 	    if ($args[0] =~ m/\*/) {
 		$args[0] =~ s/(\*+)\s*/ $1/;

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-04-07 18:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-06 18:47 [PATCH] kernel-doc: handle spaces in array size Randy Dunlap
2007-04-06 19:24 ` Jan Engelhardt
2007-04-06 23:03   ` Randy Dunlap
2007-04-06 23:38     ` Jan Engelhardt
2007-04-07  0:53       ` [PATCH v2] " Randy Dunlap
2007-04-07 15:04         ` [PATCH] kernel-doc: handle arrays with arithmetic expressions as initializers <was Re: [PATCH v2] kernel-doc: handle spaces in array size> Borislav Petkov
2007-04-07 18:26           ` Randy Dunlap
2007-04-07 18:27           ` [PATCH v3] kernel-doc: handle arrays with arithmetic expressions as initializers Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome