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

Kumar Gala galak at kernel.crashing.org
Thu Jun 10 06:12:33 CEST 2010


On Jun 9, 2010, at 10:40 PM, Timur Tabi wrote:

> 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.

will fix.

>> +
>> +       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.

Going to leave the parens for readability, will drop the break's.

- k


More information about the U-Boot mailing list