aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2017-06-09 11:41:08 +0100
committerWill Deacon <will.deacon@arm.com>2017-06-09 11:41:08 +0100
commitcc874a2246b847b9f8839301da7806b5a35a230f (patch)
treefb01517579858332e038464ad096626ef436589c
parentc0a985531f49c06fd05069024f4664740e6a0baf (diff)
downloadkvmtool-cc874a2246b847b9f8839301da7806b5a35a230f.tar.gz
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: Will Deacon <will.deacon@arm.com>
-rw-r--r--arm/fdt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arm/fdt.c b/arm/fdt.c
index f90207aa..68bbc185 100644
--- a/arm/fdt.c
+++ b/arm/fdt.c
@@ -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;