summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-03-19 12:59:20 -0600
committerBin Meng <bmeng.cn@gmail.com>2017-04-18 15:51:21 +0800
commita6eb6769c6baa28d7cfaf04ebab0e9fa5b5b834f (patch)
treecffe02bf782c1db2defd11d76b1f32e6bdc35085 /arch
parentf6c1df44b815a08585e7fd3805a1db51a5955d09 (diff)
downloadu-boot-a6eb6769c6baa28d7cfaf04ebab0e9fa5b5b834f.tar.gz
x86: Drop leading spaces in cpu_x86_get_desc()
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/cpu/cpu_x86.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/cpu/cpu_x86.c b/arch/x86/cpu/cpu_x86.c
index 8be14b5929..b465b14a94 100644
--- 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;
}