Skip to contentSkip to conversation

kernel-doc: handle/strip __init

PATCH Applied Randy Dunlap 3 participants 6 messages Jun 19, 2008 – Jul 26, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-doc: handle/strip __init

From: Randy Dunlap <[email protected]>

cc David Brownell <[email protected]>

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 ) '

---
 scripts/kernel-doc |    1 +
 1 file changed, 1 insertion(+)
scripts/kernel-doc +1 -0
@@ -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/

#1 lore raw
Quoted 3 lines · Randy Dunlap

Handle __init in functions with kernel-doc notation by stripping the __init away from the output doc.  This is already being done for "__devinit".

Right. Shouldn't this also be done for __exit and __devexit too?

#2 lore raw

--- Original Message ---

Quoted 7 lines · Randy Dunlap
Quoted 3 lines

Handle __init in functions with kernel-doc notation by stripping the __init away from the output doc. This is already being done for "__devinit".

Right. Shouldn't this also be done for __exit and __devexit too?

Yes, but I generally wait until they are needed.

~Randy

#4 lore raw
Quoted 10 lines · On Fri, 27 Jun 2008 23:05:21 +0200 Sam Ravnborg wrote:
Quoted 7 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

cc David Brownell <[email protected]>

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:

Applied

Hi Sam,

This patch is now needed so that "make *docs" does not fail.

Will you have Linus pull your tree soon or shall I send it separately?

Thanks,
---
~Randy
Linux Plumbers Conference, 17-19 September 2008, Portland, Oregon USA
http://linuxplumbersconf.org/

#5 lore raw
Quoted 11 lines · Randy Dunlap
Quoted 9 lines · On Fri, 27 Jun 2008 23:05:21 +0200 Sam Ravnborg wrote:
Quoted 7 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

cc David Brownell <[email protected]>

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:

Quoted 7 lines
Quoted 1 line

Applied

Hi Sam,

This patch is now needed so that "make *docs" does not fail.

Will you have Linus pull your tree soon or shall I send it separately?

I just returned from vacation and to a restored Internet connection today. I will prepare a pull request tonight.

Sam