public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Matthew Wilcox <matthew@wil.cx>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Harvey Harrison <harvey.harrison@gmail.com>
Subject: Re: [DOC PATCH] semaphore documentation
Date: Fri, 11 Apr 2008 22:09:11 -0700	[thread overview]
Message-ID: <20080411220911.3e7ab3e4.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080411132754.b1c1fd8f.randy.dunlap@oracle.com>

On Fri, 11 Apr 2008 13:27:54 -0700 Randy Dunlap <randy.dunlap@oracle.com> wrote:

> On Fri, 11 Apr 2008 13:21:54 -0600 Matthew Wilcox wrote:
> 
> > On Thu, Apr 10, 2008 at 03:19:07PM -0700, Andrew Morton wrote:
> > > On Thu, 10 Apr 2008 16:08:16 -0600
> > > Matthew Wilcox <matthew@wil.cx> wrote:
> > > > It seems very strange to me to document the API with the implementation
> > > > rather than with the declaration.  It's almost as if we expect people to
> > > > have to read the implementation to figure out how stuff works.
> > > 
> > > That approach makes sense for C++.  But for C, the code is .c-centric.
> > 
> > I've never programmed in C++ ... I just expect to find API documentation
> > in header files.
> > 
> > > That's particularly the case with the kernel, where we explicitly work to
> > > make the .c files the things which people look at, while not caring about
> > > the .h files.  Look at how much we say "get that ifdef out of there and
> > > hide it in the header file".
> > 
> > I see that as being "move the complexity around" and "get the interfaces
> > right", not "hide it in the header files where nobody ever looks".
> > 
> > > > How about a note in semaphore.c that says "refer to semaphore.h for
> > > > usage information"?
> > > 
> > > No, please document it in the C file, where people expect to find it.
> > 
> > Fine, I've done it the other way round.
> > 
> > Please review this doc-patch.  Without comments, I'll commit it to the
> > semaphore git tree tomorrow.
> 
> Looks good to me.  Thanks.

Yup, most excellent.

btw, down() and friends should have might_sleep() checks in them, shouldn't
they?  They don't seem to be in there, nor in mainline
lib/semaphore-sleepers.c.  Confused.


  reply	other threads:[~2008-04-12  5:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080410143403.c03757e5.akpm@linux-foundation.org>
     [not found] ` <20080410220816.GY11962@parisc-linux.org>
     [not found]   ` <20080410151907.91f11c74.akpm@linux-foundation.org>
2008-04-11 19:21     ` [DOC PATCH] semaphore documentation Matthew Wilcox
2008-04-11 20:27       ` Randy Dunlap
2008-04-12  5:09         ` Andrew Morton [this message]
2008-04-12 14:12           ` Matthew Wilcox
2008-04-12 19:27             ` Andrew Morton
2008-04-15  8:24             ` David Woodhouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080411220911.3e7ab3e4.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=harvey.harrison@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=mingo@elte.hu \
    --cc=randy.dunlap@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox