[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/7] xen/arm: Make make_cpus_node() compile at -Og


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 19 Apr 2021 15:01:26 +0100
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 19 Apr 2021 14:01:56 +0000
  • Ironport-hdrordr: A9a23:Ye+oyarXkTvSLtWJtdAfZY8aV5qzeYIsi2QD101hICF9WObwra GTtd4c0gL5jytUZWE4lbm7SdG9aF7V6JId2/hzAZ6MRw/j0VHGEKhD6s/YzyTkC2nC8IdmpM NdWoxfLPG1MlRgl8b952CDYq8d6f2K6rqhi+ub71oFd3AJV4ha4w10ChmWHyRNLWEsb/dUKL Om6sVKvDamc3gMB/7LYUUtZOTfu8bN0KvvfB9uPW9A1CC1kTiq5LTmeiL54j4iVVp0r4sKwC zgmwz96r7LiYDf9iPh
  • Ironport-sdr: iXgvNWFjzftq9wYGBW4oTykAuHznRLeVbKnWNBvkEotkRAa7LkhsKGKva+s+305aXAaJlabshm IU6D7u32Pb1HhvtT+UTsSrSAzHa16UmyUZJPPZ6EOMkH5+3NDLV+chuPzdfdkqfM+MRsW1/YZG yFcpbkZBFGHNMTZ6qWKBb8MXY9cYJZa3AaeAKTXaODDerlNxzTyZ+c1OlNBBirJTul8AD60g/a LKPt4G4z+3Cx034+kv1/cQdG+0JXkbt+pAB+j3ApuJfX8pqQtmxmf+Zy8HPPxXMLRi1q4qrngx TYQ=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

When compiling at -Og:

  domain_build.c: In function 'make_cpus_node':
  domain_build.c:926:12: error: 'clock_valid' may be used uninitialized in this 
function [-Werror=maybe-uninitialized]
    926 |         if ( clock_valid )
        |            ^

The compiler hasn't spotted that clock_valid is always initialised after the
"if ( !compatible )" check.  Initialise clock_valid to false.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Julien Grall <julien@xxxxxxx>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
---
 xen/arch/arm/domain_build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index b1d7b9849f..b10f5c8f85 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -831,7 +831,7 @@ 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;
+    bool clock_valid = false;
     uint64_t mpidr_aff;
 
     dt_dprintk("Create cpus node\n");
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.