From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756117AbYEaXpH (ORCPT ); Sat, 31 May 2008 19:45:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754982AbYEaXox (ORCPT ); Sat, 31 May 2008 19:44:53 -0400 Received: from 82-69-137-158.dsl.in-addr.zen.co.uk ([82.69.137.158]:37832 "EHLO uklogin.uk.level5networks.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754904AbYEaXox (ORCPT ); Sat, 31 May 2008 19:44:53 -0400 Date: Sun, 1 Jun 2008 00:44:27 +0100 From: Ben Hutchings To: Vegard Nossum Cc: Andrew Morton , linux-kernel@vger.kernel.org, Ingo Molnar Subject: Re: [PATCH] cputopology: Add default CPU topology information [3rd try] Message-ID: <20080531234426.GE30769@solarflare.com> References: <20080531214429.GQ1743@solarflare.com> <19f34abd0805311611x29b6a4aas572ee180ef7eb2c7@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19f34abd0805311611x29b6a4aas572ee180ef7eb2c7@mail.gmail.com> User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vegard Nossum wrote: > On Sat, May 31, 2008 at 11:44 PM, Ben Hutchings > wrote: > > Define the macros topology_{physical_package,core}_id() and > > topology_{thread,core}_siblings() in if they are not > > already defined. > > > > Move inclusion of after definitions of these > > macros in and . > > Hi again :) > > As I said in my previous e-mail, having #includes in the middle of > headers is nasty. This kind of dependency is really subtle and makes > later modification much harder. (Actually, it hurts readability as > well.) It is a bit nasty, but it seems to be reasonably common to include toward the end of . So I think anyone working with an asm header should expect that. > The standard way to do this seems to be: > > asm/topology.h should define ARCH_HAS_* macros if it wishes to > override the defaults > linux/topology.h should #include asm/topology.h at the top of the file > linux/topology.h should define the generic functions/macros only if > the ARCH_HAS_* macros are undefined > > Other files wishing to use these definitions should then include > linux/topology.h. > > Or is that unfeasible in this case? It seem feasible, though there is no need for ARCH_HAS_* macros given that the features being described are themselves macros. I would be happy to move the defaults to . Actually, everything in could probably be moved to . Ben. -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job.