public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [patch 1/3] epoll cleanups - epoll include diet ...
Date: Thu, 5 Apr 2007 18:24:07 -0700	[thread overview]
Message-ID: <20070405182407.a785b895.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0704051806300.27713@alien.or.mcafeemobile.com>

On Thu, 5 Apr 2007 18:12:58 -0700 (PDT)
Davide Libenzi <davidel@xmailserver.org> wrote:

> On Thu, 5 Apr 2007, Andrew Morton wrote:
> 
> > epoll uses signal stuff and might need signal.h.  It implements syscalls
> > and it certainly needs to have those syscall's prototypes in scope.  It
> > surely uses stuff from mm.h (doesn't everything??)
> 
> Ack about signal.h, I forgot about the pwait code :(
> Why syscalls.h? The eventpoll.c file expots syscalls, but it doesn't use 
> anything declared in there.

So that the compiler can verify that our declarations of sys_epoll_foo()
match our definitions of them.

> What does eventpoll.c use *directly* from mm.h? If eventpoll.c uses, let's 
> say sched.h, and sched.h needs mm.h, it is sched.h responsibility to 
> include the mm.h file not eventpoll.c one.
> 

Sure.  But if epoll.c _does_ use something from mm.h (or uses something
from a header which mm.h includes) then if we later remove the #include
mm.h from sched.h, eventpoll.c will break.

The general rule is: include in .c the header files which provide the stuff
which that .c file uses.  Now, it maybe that eventpoll.c indeed uses nothing
which mm.h provides, and nothing which mm.h's includees provide.  But it is
non-trivial to prove that.  Once added, includes are hard to remove :(

  reply	other threads:[~2007-04-06  1:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-04  1:35 [patch 1/3] epoll cleanups - epoll include diet Davide Libenzi
2007-04-06  0:59 ` Andrew Morton
2007-04-06  1:12   ` Davide Libenzi
2007-04-06  1:24     ` Andrew Morton [this message]
2007-04-06 18:27       ` Davide Libenzi

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=20070405182407.a785b895.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    /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