mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Hans-Jürgen Koch" <hjk@linutronix.de>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: "Ulf Samuelsson" <ulf@atmel.com>,
	"Marc Pignat" <marc.pignat@hevs.ch>,
	andrew@sanpeople.com, trivial@kernel.org,
	linux-kernel@vger.kernel.org, Andy Herzig <andrew.herzig@ngc.com>
Subject: Re: [PATCH] at91 pm: Compilation fix for at91sam926x
Date: Fri, 10 Aug 2007 09:12:35 +0200	[thread overview]
Message-ID: <200708100912.35485.hjk@linutronix.de> (raw)
In-Reply-To: <018a01c7dad3$10ca8190$dcc4af0a@atmel.com>

Am Freitag 10 August 2007 00:15 schrieb Ulf Samuelsson:
> 
> > > +#if defined(CONFIG_ARCH_AT91RM9200)
> > >                         at91_sys_write(AT91_SDRAMC_SRR, 1);     /*
> > > self-refresh mode */
> 
> > Why don't use:
> > if (cpu_is_at91rm9200())
> > at91_sys_write(AT91_SDRAMC_SRR, 1);
> 
> What is the benefit?
> Will the optimizer remove the code if the CPU is not the at91rm9200?

No, it won't. cpu_is_something() is intended for runtime decisions.
Remember that the purpose of this patch was to solve a compile time
issue (see subject). AT91_SDRAMC_SRR isn't defined properly for
non-9200 processors because they don't have that register. So we need
something like #ifdef to include this line only on 9200.

Hans

  reply	other threads:[~2007-08-10  7:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-09 12:10 Andy Herzig
2007-08-09 14:39 ` Andy Herzig
2007-08-09 14:53 ` Hans-Jürgen Koch
2007-08-09 16:01   ` Marc Pignat
2007-08-09 17:17     ` Andy Herzig
2007-08-09 18:19       ` Hans-Jürgen Koch
2007-08-09 22:15     ` Ulf Samuelsson
2007-08-10  7:12       ` Hans-Jürgen Koch [this message]
2007-08-10  7:33         ` Marc Pignat
     [not found]           ` <3858727143598039860@unknownmsgid>
2007-08-10 10:00             ` Michel Benoit
2007-08-24  7:11               ` Andrew Victor
2007-08-10 13:54           ` Ulf Samuelsson

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=200708100912.35485.hjk@linutronix.de \
    --to=hjk@linutronix.de \
    --cc=andrew.herzig@ngc.com \
    --cc=andrew@sanpeople.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.pignat@hevs.ch \
    --cc=trivial@kernel.org \
    --cc=ulf@atmel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®