linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 1/2] ARM: shmobile: sh73a0: enable PMU(Performance Monitoring Unit)
Date: Wed, 05 Sep 2012 05:45:22 +0000	[thread overview]
Message-ID: <20120905054521.GA13568@linux-sh.org> (raw)
In-Reply-To: <1346813317-4030-2-git-send-email-koba@kmckk.co.jp>

On Wed, Sep 05, 2012 at 11:48:36AM +0900, Tetsuyuki Kobayshi wrote:
> +#ifdef CONFIG_HW_PERF_EVENTS
> +static struct resource pmu_resources[] = {
> +	[0] = {
> +		.start	= gic_spi(55),
> +		.end	= gic_spi(55),
> +		.flags	= IORESOURCE_IRQ,
> +	},
> +	[1] = {
> +		.start	= gic_spi(56),
> +		.end	= gic_spi(56),
> +		.flags	= IORESOURCE_IRQ,
> +	},
> +};
> +
> +static struct platform_device pmu_device = {
> +	.name		= "arm-pmu",
> +	.id		= ARM_PMU_DEVICE_CPU,
> +	.num_resources	= ARRAY_SIZE(pmu_resources),
> +	.resource	= pmu_resources,
> +};
> +#endif
> +
There is no need for the ifdef for any of these, if perf events aren't
enabled then the arm-pmu driver to claim the platform device won't exist
and this is all harmless, as with every other platform device.

In general you should try to avoid adding ifdefs as much as possible, as
they make things not only uglier, but they lock you down to one static
configuration, while all the infrastructure exists to manage thingn for
you in a dynamic fashion.

  reply	other threads:[~2012-09-05  5:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05  2:48 [PATCH 1/2] ARM: shmobile: sh73a0: enable PMU(Performance Monitoring Unit) Tetsuyuki Kobayshi
2012-09-05  5:45 ` Paul Mundt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-09-11  8:05 [GIT] Renesas ARM-based SoC: pmu/cleanup for 3.7 Simon Horman
2012-09-11  8:05 ` [PATCH 1/2] ARM: shmobile: sh73a0: enable PMU(Performance Monitoring Unit) Simon Horman

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=20120905054521.GA13568@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).