From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:9642 "EHLO mx2.suse.de") by vger.kernel.org with ESMTP id S1751051AbWJWBbY (ORCPT ); Sun, 22 Oct 2006 21:31:24 -0400 From: Andi Kleen Subject: Re: dealing with excessive includes Date: Mon, 23 Oct 2006 03:31:16 +0200 References: <20061018091944.GA5343@martell.zuzino.mipt.ru> <200610230242.58647.ak@suse.de> <20061023010812.GE25210@parisc-linux.org> In-Reply-To: <20061023010812.GE25210@parisc-linux.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610230331.16573.ak@suse.de> Sender: linux-arch-owner@vger.kernel.org To: Matthew Wilcox Cc: Geert Uytterhoeven , Randy Dunlap , Stefan Richter , Al Viro , Linus Torvalds , Alexey Dobriyan , Linux Kernel Development , linux-arch@vger.kernel.org List-ID: On Monday 23 October 2006 03:08, Matthew Wilcox wrote: > 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. If you require it to do something it isn't a comment anymore -- it would become a language extension. > > Here's the problem. If a file needs canonicalize_irq(), it should > include (which eventually ends up including > asm/irq,h), and not (where it's defined). > If a file needs add_wait_queue(), it should include > (where it's defined) and not (which directly includes > linux/wait.h>. > > Please define an algorithm which distinguishes the two cases. Needs are inside {} or in a macro definition So if the identifier happens after #define or inside {} assume the symbol is needed from somewhere else, otherwise it is declared here. That is likely not 100% foolproof, but should be good enough and the mismatches can be resolved by hand. -Andi