From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.238]) by ozlabs.org (Postfix) with ESMTP id AE304DDEF0 for ; Thu, 10 May 2007 17:54:50 +1000 (EST) Received: by wr-out-0506.google.com with SMTP id 50so502160wra for ; Thu, 10 May 2007 00:54:49 -0700 (PDT) Message-ID: Date: Thu, 10 May 2007 13:24:48 +0530 From: "Satyam Sharma" To: "Benjamin Herrenschmidt" Subject: Re: [PATCH 2/3] Add hard_irq_disable() In-Reply-To: <1178781677.14928.221.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed References: <20070510052622.3E8D5DDF4B@ozlabs.org> <20070509224113.cca81a24.akpm@linux-foundation.org> <1178781677.14928.221.camel@localhost.localdomain> Cc: linuxppc-dev@ozlabs.org, Andrew Morton , Rusty Russell , linux-kernel@vger.kernel.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 5/10/07, Benjamin Herrenschmidt wrote: > > > So you're saying that this mechanism forces the arch (that really > > wants hard_irq_disable) to _#define_ hard_irq_disable (as a macro), > > and if it implements it as an inline function, for example, then we're > > screwed? > > No. The idea is to do like we did for a few other things already > (according to Linus request in fact), which is to write > > static inline void hard_irq_disable(void) > { > .../... > } > #define hard_irq_disable hard_irq_disable > > This is nicer than having an ARCH_HAS_xxx Ok, that's reasonable, we don't want to end up with zillions of ARCH_HAS_THIS and ARCH_HAS_THAT. But then, what _is_ the problem with your approach above? An arch that wants (and implements) hard_irq_disable will also #define that dummy macro, so we just need to pull in the appropriate header (directly, indirectly, anyhow -- we don't really care) into include/linux/interrupt.h and then just do the exact same "#ifndef hard_irq_disable" check that you're doing right now. I must be missing something trivial (either that or I need to go and have a coffee :-) because I don't see the possibility of hitting multiple _different_ definitions with the approach you mentioned just now.