Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030724AbWLETvw (ORCPT ); Tue, 5 Dec 2006 14:51:52 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030726AbWLETvw (ORCPT ); Tue, 5 Dec 2006 14:51:52 -0500 Received: from mail.tmr.com ([64.65.253.246]:48081 "EHLO gaimboi.tmr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030724AbWLETvv (ORCPT ); Tue, 5 Dec 2006 14:51:51 -0500 Message-ID: <4575CEAC.2010503@tmr.com> Date: Tue, 05 Dec 2006 14:55:24 -0500 From: Bill Davidsen Organization: TMR Associates Inc, Schenectady NY User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.8) Gecko/20061105 SeaMonkey/1.0.6 MIME-Version: 1.0 To: Jaswinder Singh CC: linux-kernel@vger.kernel.org Subject: Re: PREEMPT is messing with everyone References: <45758B57.6040107@stud.feec.vutbr.cz> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1255 Lines: 52 Jaswinder Singh wrote: > On 12/5/06, Michal Schmidt wrote: >> Jaswinder Singh wrote: >> > Hi, >> > >> > preempt stuff SHOULD only stay in #ifdef CONFIG_PREEMP_* , but it is >> > messing with everyone even though not defined. >> > >> > e.g. >> > >> > 1. linux-2.6.19/kernel/spinlock.c >> > >> > Line 18: #include >> > >> > Line 26: preempt_disable(); >> > >> > Line 32: preempt_disable(); >> > >> > and so on . >> >> Don't worry. These compile into "do { } while (0)" (i.e. nothing) when >> CONFIG_PREEMPT is not set. >> > > Yes, Compiler will remove it but this looks ugly and confusing. > > Why dont we use like this :- Because it's ugly and confusing. > > #ifdef CONFIG_PREEMPT > #include > #endif > > #ifdef CONFIG_PREEMPT > preempt_disable(); > #endif > > #ifdef CONFIG_PREEMPT > preempt_enable(); > #endif -- bill davidsen CTO TMR Associates, Inc Doing interesting things with small computers since 1979 - 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/