Commit cc874a22 authored by Will Deacon's avatar Will Deacon
Browse files

ARM: fdt: Bump CPU_NAME_MAX_LEN to avoid silly GCC warning



GCC 7 warns about truncating the mpidr when we print the cpu_name into
the device tree:

arm/fdt.c: In function ‘setup_fdt’:
arm/fdt.c:58:45: error: ‘%lx’ directive output may be truncated writing between 1 and 10 bytes into a region of size 7 [-Werror=format-truncation=]
   snprintf(cpu_name, CPU_NAME_MAX_LEN, "cpu@%lx", mpidr);

Fix this by bumping the buffer to 15 bytes. We really only need 11 bytes,
but GCC isn't smart enough to identify that we mask out the top buts
of the MPIDR and the analysis just seems to be based on types.

Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent c0a98553
......@@ -40,7 +40,7 @@ static void dump_fdt(const char *dtb_file, void *fdt)
close(fd);
}
#define CPU_NAME_MAX_LEN 8
#define CPU_NAME_MAX_LEN 15
static void generate_cpu_nodes(void *fdt, struct kvm *kvm)
{
int cpu;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment