All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>,
	Linux Kernel List <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: lockdep: results on ARM
Date: Thu, 27 Jul 2006 13:46:40 -0700	[thread overview]
Message-ID: <44C92630.403@zytor.com> (raw)
In-Reply-To: <1154010723.3039.59.camel@laptopd505.fenrus.org>

Arjan van de Ven wrote:
> On Thu, 2006-07-27 at 15:24 +0100, Russell King wrote:
>> +#ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW
>> +	p->hardirqs_enabled = 1;
>> +#else
>>  	p->hardirqs_enabled = 0;
>> +#endif
> 
> if __ARCH_WANT_INTERRUPTS_ON_CTXSW is set to 1 for arm you can turn this
> into
> 
> p->hardirqs_enabled = __ARCH_WANT_INTERRUPTS_ON_CTXSW + 0;
> 
> and save the ifdef ;)
> 

#ifdef is actually really evil.  It's much cleaner to use #if and make 
sure everything defines either 0 or 1.  Partially because it often makes 
you not have to add an #if at all, but also because it makes it 
immediately obvious if some definition was missed.

	-hpa

      reply	other threads:[~2006-07-27 20:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-27 14:24 lockdep: results on ARM Russell King
2006-07-27 14:23 ` Ingo Molnar
2006-07-27 14:32 ` Arjan van de Ven
2006-07-27 20:46   ` H. Peter Anvin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44C92630.403@zytor.com \
    --to=hpa@zytor.com \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rmk+lkml@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.