From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tabi Timur-B04825 Date: Fri, 29 Apr 2011 22:38:59 +0000 Subject: [U-Boot] [PATCH] [v4] powerpc/85xx: fix compatible property for the L2 cache node In-Reply-To: <20110429222131.D6114D5270C@gemini.denx.de> References: <1304113875-6749-1-git-send-email-timur@freescale.com> <20110429222131.D6114D5270C@gemini.denx.de> Message-ID: <4DBB3E01.7000704@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.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