public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tabi Timur-B04825 <B04825@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] [v4] powerpc/85xx: fix compatible property for the L2 cache node
Date: Fri, 29 Apr 2011 22:38:59 +0000	[thread overview]
Message-ID: <4DBB3E01.7000704@freescale.com> (raw)
In-Reply-To: <20110429222131.D6114D5270C@gemini.denx.de>

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

  reply	other threads:[~2011-04-29 22:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-29 21:51 [U-Boot] [PATCH] [v4] powerpc/85xx: fix compatible property for the L2 cache node Timur Tabi
2011-04-29 22:21 ` Wolfgang Denk
2011-04-29 22:38   ` Tabi Timur-B04825 [this message]
2011-04-29 22:51     ` Wolfgang Denk
2011-04-29 22:58       ` Tabi Timur-B04825

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=4DBB3E01.7000704@freescale.com \
    --to=b04825@freescale.com \
    --cc=u-boot@lists.denx.de \
    /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