Skip to contentSkip to conversation

Kernel function documentation question

DISCUSSION Ben Dooks 2 participants 2 messages Dec 16, 2008

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

The Documentation/kernel-doc-nano-HOWTO.txt says that functions should be documented as so:

/**
* foobar() - short function description of foobar

I notice there are a number of places that ommit the () off the foobar, for example:

include/linux/skbuff.h, line 461:

/**
* skb_get - reference buffer
* @skb: buffer to reference

where skb_get does not have ()s.

As a note, it seems the default debian emacs does not colour the function name unless it ends ().

Also, is there any policy on tabs vs a single space for indenting these comments?

Signature · 3 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'
#1 lore raw
Quoted 2 lines · Ben Dooks

The Documentation/kernel-doc-nano-HOWTO.txt says that functions should be documented as so:

That's an example. There is no "should" with that example.

Quoted 6 lines

/**
* foobar() - short function description of foobar

I notice there are a number of places that ommit the () off the foobar, for example:

Quoted 7 lines

include/linux/skbuff.h, line 461:

/**
* skb_get - reference buffer
* @skb: buffer to reference

where skb_get does not have ()s.

That's perfectly fine. The "formal" syntax is given later in that file:

The format of the block comment is like this:

/**
* function_name(:)? (- short description)?
(* @parameterx(space)*: (description of parameter x)?)* (* a blank line)?
* (Description:)? (Description of function)?
* (section header: (section description)? )*
(*)?*/

and those parentheses are (confusing) grouping characters, not literals. :(

Quoted 2 lines

As a note, it seems the default debian emacs does not colour the function name unless it ends ().

File a bug with debian?

Quoted 2 lines

Also, is there any policy on tabs vs a single space for indenting these comments?

Nope. I prefer a single space, but some people seem to prefer tab(s).

~Randy