[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] xen/arm: fix uninitialized use warning
commit 3adcfbd316c9e82b2ad311450f21f330bfdc1f41 Author: Stewart Hildebrand <stewart.hildebrand@xxxxxxx> AuthorDate: Fri Apr 14 14:57:14 2023 -0400 Commit: Julien Grall <jgrall@xxxxxxxxxx> CommitDate: Wed Apr 19 19:28:27 2023 +0100 xen/arm: fix uninitialized use warning When building the hypervisor with -Og and GCC 11/12, we encounter the following error: arch/arm/domain_build.c: In function â??make_cpus_nodeâ??: arch/arm/domain_build.c:2040:12: error: â??clock_validâ?? may be used uninitialized [-Werror=maybe-uninitialized] 2040 | if ( clock_valid ) | ^ arch/arm/domain_build.c:1947:10: note: â??clock_validâ?? was declared here 1947 | bool clock_valid; | ^~~~~~~~~~~ cc1: all warnings being treated as errors Fix it by initializing the variable. Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx> Reviewed-by: Henry Wang <Henry.Wang@xxxxxxx> Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx> --- xen/arch/arm/domain_build.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 4f9d4f9d88..f80fdd1af2 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1944,7 +1944,8 @@ static int __init make_cpus_node(const struct domain *d, void *fdt) /* Placeholder for cpu@ + a 32-bit hexadecimal number + \0 */ char buf[13]; u32 clock_frequency; - bool clock_valid; + /* Keep the compiler happy with -Og */ + bool clock_valid = false; uint64_t mpidr_aff; dt_dprintk("Create cpus node\n"); -- generated by git-patchbot for /home/xen/git/xen.git#master
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |