All of lore.kernel.org
 help / color / mirror / Atom feed
* Kernel function documentation question
@ 2008-12-16 21:18 Ben Dooks
  2008-12-16 21:29 ` Randy Dunlap
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Dooks @ 2008-12-16 21:18 UTC (permalink / raw)
  To: linux-kernel

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?

-- 
Ben (ben@fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

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

* Re: Kernel function documentation question
  2008-12-16 21:18 Kernel function documentation question Ben Dooks
@ 2008-12-16 21:29 ` Randy Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: Randy Dunlap @ 2008-12-16 21:29 UTC (permalink / raw)
  To: Ben Dooks; +Cc: linux-kernel

Ben Dooks wrote:
> 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.

> /**
>  * 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.

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.  :(


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

File a bug with debian?

> 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

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

end of thread, other threads:[~2008-12-16 21:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-16 21:18 Kernel function documentation question Ben Dooks
2008-12-16 21:29 ` Randy Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.