[U-Boot] [PATCH] ppc/8xxx: Add is_core_disabled to remove disabled cores from dtb

Timur Tabi timur.tabi at gmail.com
Thu Jun 10 05:40:57 CEST 2010


On Wed, Jun 9, 2010 at 10:34 PM, Kumar Gala <galak at kernel.crashing.org> wrote:

> +int is_core_disabled(int nr) {
> +       volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
> +       u32 coredisrl = in_be32(&gur->coredisrl);

You don't need to declare the variable as volatile if you use an I/O accessor.

> +int is_core_disabled(int nr) {
> +       volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
> +       u32 devdisr = in_be32(&gur->devdisr);

Same thing here.

> +
> +       switch (nr) {
> +       case 0:
> +               return (devdisr & MPC85xx_DEVDISR_CPU0);
> +               break;
> +       case 1:
> +               return (devdisr & MPC85xx_DEVDISR_CPU1);
> +               break;

And you don't need a 'break' after a 'return' in a switch-case
statement.  You also don't need parentheses around the expression in
the 'return' statement.

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the U-Boot mailing list