linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Joseph Lo <josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 2/4] ARM: tegra: hook tegra_tear_down_cpu function in the PM suspend init function
Date: Mon, 03 Jun 2013 14:31:26 -0600	[thread overview]
Message-ID: <51ACFD1E.4070102@wwwdotorg.org> (raw)
In-Reply-To: <1370258267-30184-3-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

On 06/03/2013 05:17 AM, Joseph Lo wrote:
> The tegra_tear_down_cpu was used to cut off the CPU rail for various Tegra
> SoCs. Hooking it in the PM suspend init function and making the CPUidle
> driver more generic.

> diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c

> +static void tegra_tear_down_cpu_init(void)
> +{
> +	if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && tegra_chip_id == TEGRA20)
> +		tegra_tear_down_cpu = tegra20_tear_down_cpu;
> +	if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) && tegra_chip_id == TEGRA30)
> +		tegra_tear_down_cpu = tegra30_tear_down_cpu;
> +}

I think you should use a switch statement there instead:

switch (tegra_chip_id) {
case TEGRA20:
	if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC))
		tegra_tear_down_cpu = tegra20_tear_down_cpu;
	break;
...

Similar for patch 3/4. This makes it a lot more obvious that it's
selecting an option based on the runtime SoC, rather than just a bunch
of if conditions that each may or may-not be doing similar things.

  parent reply	other threads:[~2013-06-03 20:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03 11:17 [PATCH 0/4] ARM: tegra: cpuidle: some clean up for CPUidle driver Joseph Lo
     [not found] ` <1370258267-30184-1-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-06-03 11:17   ` [PATCH 1/4] ARM: tegra: cpuidle: move the init function behind the suspend init function Joseph Lo
2013-06-03 11:17   ` [PATCH 2/4] ARM: tegra: hook tegra_tear_down_cpu function in the PM " Joseph Lo
     [not found]     ` <1370258267-30184-3-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-06-03 20:31       ` Stephen Warren [this message]
2013-06-03 11:17   ` [PATCH 3/4] ARM: tegra: cpuidle: using IS_ENABLED for multi SoCs management in init func Joseph Lo
2013-06-03 11:17   ` [PATCH 4/4] ARM: tegra: check processor id in tegra_{set,clear}_cpu_in_lp2 Joseph Lo
     [not found]     ` <1370258267-30184-5-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-06-03 20:35       ` Stephen Warren

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=51ACFD1E.4070102@wwwdotorg.org \
    --to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
    --cc=josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).