lkml.org 
[lkml]   [2008]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: whose job is it to include various header files?
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
========================================================================


\
 
 \ /
  Last update: 2008-03-14 02:05    [W:0.073 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site