[U-Boot] [PATCH] [v4] powerpc/85xx: fix compatible property for the L2 cache node

Tabi Timur-B04825 B04825 at freescale.com
Sat Apr 30 00:38:59 CEST 2011


Wolfgang Denk wrote:
> Why do we need this "if" at all? tolower() on a digit is a nop, so you
> can omit the first branch.

Because cpu->name looks like one of two ways:

	8578

or
	
	P4080

In the case of "8578", we want to convert that to "mpc8578".  In the case of "P4080", we want to convert that to "p4080".

The "if" is need to determine whether to prepend the "mpc".

>> >  +		/* append "cache" to the string */
>> >  +		len += sprintf(buf + len, "cache") + 1;
> This is wrong and misleading.  This is not an operation on a C string.
> You do not "append" (or concatenate) the string cache.  You build a
> specifically structured data set, which is not a C string.  So please
> don't call it a string.

Ok.

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the U-Boot mailing list