lkml.org 
[lkml]   [2006]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: dealing with excessive includes
> module.h is trickier.  First of all, we want extern for wake_up_process().

When I came up with this to l-k, Nick and Christoph told me that duplicate
proto sucks. So module.h/sched.h is
a) uninline module_put()
b) remove #include <linux/sched.h>

> And unlike the first severed include, we *do* have files that need something
> from sched.h and rely on pulling it implicitly via module.h. Fortunately,
> there are few of those. For amd64 allmodconfig we only need to touch includes
> in
> arch/i386/kernel/cpu/mcheck/therm_throt.c
> drivers/hwmon/abituguru.c
> drivers/leds/ledtrig-ide-disk.c
> drivers/leds/ledtrig-timer.c
> drivers/scsi/scsi_transport_sas.c
> drivers/w1/slaves/w1_therm.c
> include/linux/phy.h
> kernel/latency.c
> and in almost all cases we are actually missing jiffies.h, not sched.h.
> However, at that point we really need to look at other targets; they
> do add several extra places, but again not much. Below is what I've got
> from my usual mix of cross-builds; for resulting dependeny counts (again,
> amd64 allmodconfig) see ftp://ftp.linux.org.uk/pub/people/viro/counts-after.

> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -6,7 +6,6 @@ #define _LINUX_MODULE_H
> * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996
> * Rewritten again by Rusty Russell, 2002
> */
> -#include <linux/sched.h>
> #include <linux/spinlock.h>
> #include <linux/list.h>
> #include <linux/stat.h>
> @@ -410,6 +409,8 @@ static inline int try_module_get(struct
> return ret;
> }
>
> +extern int FASTCALL(wake_up_process(struct task_struct * tsk));
> +
> static inline void module_put(struct module *module)
> {
> if (module) {

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-10-18 11:23    [W:0.574 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site