lkml.org 
[lkml]   [2006]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: dealing with excessive includes
    On Mon, Oct 23, 2006 at 02:42:58AM +0200, Andi Kleen wrote:
    >
    > > /*+
    > > * Provides: struct sched
    > > * Provides: total_forks, nr_threads, process_counts, nr_processes()
    > > * Provides: nr_running(), nr_uninterruptible(), nr_active(), nr_iowait(), weighted_cpuload()
    > > */
    >
    > That's ugly. If it needs that i don't think it's a good idea.
    > We really want standard C, not some Linux dialect.

    Um, that's a comment. It's standard C.

    > In theory it is even to do it automated without comments
    > just based on the referenced symbols, except if stuff is hidden in macros
    > (but then the include defining the macro should have the right includes
    > anyways). Another issue would be different name spaces - if there is both
    > typedef foo and struct foo and nested local foo a script might have a little trouble
    > distingushing them, but i suspect that won't be a big issue.

    Sorry, I assumed you'd've spent some time thinking about the problem.

    Here's the problem. If a file needs canonicalize_irq(), it should
    include <linux/interrupt.h> (which eventually ends up including
    asm/irq,h), and not <asm/irq.h> (where it's defined).
    If a file needs add_wait_queue(), it should include <linux/wait.h>
    (where it's defined) and not <linux/fs.h> (which directly includes
    linux/wait.h>.

    Please define an algorithm which distinguishes the two cases.
    -
    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-23 03:11    [W:3.447 / U:0.612 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site