mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: whose job is it to include various header files?
Date: Thu, 13 Mar 2008 21:02:01 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.1.00.0803132100270.21017@localhost.localdomain> (raw)
In-Reply-To: <9a8748490803131653n7f1c2bd0m12e30d82bf936d03@mail.gmail.com>

On Fri, 14 Mar 2008, Jesper Juhl wrote:

> On 13/03/2008, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> >
> >   more a philosophy question than anything but, while poking around
> >  the percpu stuff today, i noticed in the header file linux/percpu.h
> >  the opening snippet:
> >
> >   #include <linux/preempt.h>
> >   #include <linux/slab.h> /* For kmalloc() */
> >   #include <linux/smp.h>
> >   #include <linux/string.h> /* For memset() */
> >   #include <linux/cpumask.h>
> >   ...

> I agree with you completely. A file should explicitly include
> headers for the stuff it uses and not rely on implicit includes done
> elsewhere. Cleaning that up is going to touch a lot of files though
> for no real short term gain (there is a long term gain of
> maintainability though), so it's going to be a loveless job :(

i wasn't about to run off and start changing stuff, i was just curious
about the general philosophy.  i *might* see the value of a patch if
it's a cleanup that affects a restricted set of files that are
logically related and can be done with a single patch.  beyond that,
no.

the only reason the above example caught my eye is the insistence in
the comments as to why those includes were there, when there were no
invocations of those routines anywhere in the file.  i always find
that curious.

rday
--


========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================

  reply	other threads:[~2008-03-14  1:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-13 22:09 Robert P. J. Day
2008-03-13 22:46 ` Randy Dunlap
2008-03-13 23:53 ` Jesper Juhl
2008-03-14  1:02   ` Robert P. J. Day [this message]
2008-03-14  1:36   ` Jan Engelhardt
2008-03-14  1:53     ` Robert P. J. Day
2008-03-14  5:47       ` Alexey Dobriyan
2008-03-14  8:01         ` Robert P. J. Day
2008-03-14  6:47   ` mws
2008-03-14  8:07     ` Robert P. J. Day
2008-03-14  9:29       ` Robert P. J. Day

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=alpine.LFD.1.00.0803132100270.21017@localhost.localdomain \
    --to=rpjday@crashcourse.ca \
    --cc=jesper.juhl@gmail.com \
    --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

all inboxes | Powered by JetHome®