[PATCH] kernel-doc: handle/strip __init

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Randy Dunlap
Date: Thursday, June 19, 2008 - 4:03 pm

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

cc: David Brownell <dbrownell@users.sourceforge.net>

Handle __init in functions with kernel-doc notation by stripping the
__init away from the output doc.  This is already being done for
"__devinit".  This patch fixes these kernel-doc error/aborts:

Error(linux-next-20080619//drivers/usb/gadget/config.c:132): cannot understand prototype: 'struct usb_descriptor_header **__init usb_copy_descriptors(struct usb_descriptor_header **src) '
Error(linux-next-20080619//drivers/usb/gadget/config.c:182): cannot understand prototype: 'struct usb_endpoint_descriptor *__init usb_find_endpoint( 	struct usb_descriptor_header **src, 	struct usb_descriptor_header **copy, 	struct usb_endpoint_descriptor *match ) '

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

--- linux-next-20080619.orig/scripts/kernel-doc
+++ linux-next-20080619/scripts/kernel-doc
@@ -1643,6 +1643,7 @@ sub dump_function($$) {
     $prototype =~ s/^__always_inline +//;
     $prototype =~ s/^noinline +//;
     $prototype =~ s/__devinit +//;
+    $prototype =~ s/__init +//;
     $prototype =~ s/^#define\s+//; #ak added
     $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//;
 


---
~Randy
Linux Plumbers Conference, 17-19 September 2008, Portland, Oregon USA
http://linuxplumbersconf.org/
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] kernel-doc: handle/strip __init, Randy Dunlap, (Thu Jun 19, 4:03 pm)
Re: [PATCH] kernel-doc: handle/strip __init, David Brownell, (Thu Jun 19, 4:52 pm)
Re: [PATCH] kernel-doc: handle/strip __init, Randy Dunlap, (Thu Jun 19, 6:06 pm)
Re: [PATCH] kernel-doc: handle/strip __init, Sam Ravnborg, (Fri Jun 27, 2:05 pm)
Re: [PATCH] kernel-doc: handle/strip __init, Randy Dunlap, (Tue Jul 22, 1:36 pm)
Re: [PATCH] kernel-doc: handle/strip __init, Sam Ravnborg, (Fri Jul 25, 11:52 am)