From: Simon Glass Date: Sun, 19 Mar 2017 18:59:20 +0000 (-0600) Subject: x86: Drop leading spaces in cpu_x86_get_desc() X-Git-Tag: v2017.05-rc3~62^2~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a6eb6769c6baa28d7cfaf04ebab0e9fa5b5b834f;p=oweals%2Fu-boot.git 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 Reviewed-by: Bin Meng --- 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; }