Re: [PATCH 2/4] sparc32,leon: always include leon_pmc in build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 26, 2012 at 04:43:27PM +0200, Sam Ravnborg wrote:
> @@ -65,13 +66,15 @@ void pmc_leon_idle(void)
>  /* Install LEON Power Down function */
>  static int __init leon_pmc_install(void)
>  {
> -	/* Assign power management IDLE handler */
> -	if (pmc_leon_need_fixup())
> -		pm_idle = pmc_leon_idle_fixup;
> -	else
> -		pm_idle = pmc_leon_idle;
> +	if (sparc_cpu_model == sparc_leon) {
> +		/* Assign power management IDLE handler */
> +		if (pmc_leon_need_fixup())
> +			pm_idle = pmc_leon_idle_fixup;
> +		else
> +			pm_idle = pmc_leon_idle;
>  
> -	printk(KERN_INFO "leon: power management initialized\n");
> +		printk(KERN_INFO "leon: power management initialized\n");
> +	}
>  
>  	return 0;
>  }

Why not simply invert the logic and save a level of indentation?

if (sparc_cpu_model != sparc_leon)
	return 0;

Possibly also return something like -EINVAL - but I don't know the caller's
MO offhand so the fake 0 might actually be better.

-- 
     2. That which causes joy or happiness.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux