projects
/
oweals
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6c1df4
)
x86: Drop leading spaces in cpu_x86_get_desc()
author
Simon Glass
<sjg@chromium.org>
Sun, 19 Mar 2017 18:59:20 +0000
(12:59 -0600)
committer
Bin Meng
<bmeng.cn@gmail.com>
Tue, 18 Apr 2017 07:51:21 +0000
(15:51 +0800)
The Intel CPU name can have leading spaces. Remove them since they are not
useful.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/cpu_x86.c
patch
|
blob
|
history
diff --git
a/arch/x86/cpu/cpu_x86.c
b/arch/x86/cpu/cpu_x86.c
index 8be14b5929110dd4dd29d107d4168630fb6b4065..b465b14a948ed715b170baecfedf4b34fa4b312d 100644
(file)
--- a/
arch/x86/cpu/cpu_x86.c
+++ b/
arch/x86/cpu/cpu_x86.c
@@
-41,10
+41,14
@@
int cpu_x86_get_vendor(struct udevice *dev, char *buf, int size)
int cpu_x86_get_desc(struct udevice *dev, char *buf, int size)
{
+ char *ptr;
+
if (size < CPU_MAX_NAME_LEN)
return -ENOSPC;
- cpu_get_name(buf);
+ ptr = cpu_get_name(buf);
+ if (ptr != buf)
+ strcpy(buf, ptr);
return 0;
}