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

Re: [PATCH 3/3] xen/arm: fix unitialized use warning


  • To: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Sun, 16 Apr 2023 22:03:18 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZB7rQPXzigjksR8cneF7KMo407F4iVd+/nvEuzD/dHE=; b=jflfrYobF/4cG6Y5nVmwbWVyXeAyLs1Gip5Eg/AL+WsC0ifPDE07zsjX8MH6rGOfYvYBa0s0VVCub9snfd4dnVhjsWdCqbE6H24D0h8BlzZLOLCPRqRd4NYRe8gWmjn5vacwXqVoSm/9rl6EQZQY9GE6YmV3cd0c1EFeLjiUMpxrfoJT7q5X6YY1gyXs5PLu0bUQhMkZizGwVZTMNhBzVRoQDsSSysQZJ0sXP2M5hnRNg9lRZsEYZpDxhztCqKGdt4Z3bsI0BL0z8vOm5QAv2OhVgxDsH49eWNNs7sRyH8b9FHlGKlrgS3ZuBBa8ErJoSydVnQFEn0ooI6R+6oI2JQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=On2SCcY6aju3Jng6z40Qs4oriGZ1xQNrxQlyD+CstrQcq8DhmCAqiGl1/aeG61PcMWpvSm6Vj1/dpmdXilZIepQ6O97hnkDZdk4WeuSzj8oijPWA0PdwjoIU6ndCRvUo0SGVQZdfa0YV3HAb9+zr+YLSauZPElkWvAPKt+64ecmiYywwpvHuMoORfcj1N/YD6FhqD4r+UbWCEpX0aNsKyMpydDBidqgAR30ShzSgCASY4VQuyns5hDyJHrD+b15ynYPGLySeJ1FIEWWtJgFjkPFEcEE4Lx5Ypr4P+UUJMWblAN9EaIO5j1dDHKR+Iq3/xWWM/U0oLMjeAD4qSelGsg==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 17 Apr 2023 02:03:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 4/16/23 08:53, Julien Grall wrote:
> Hi Stewart,

Hi Julien,

> On 14/04/2023 19:57, Stewart Hildebrand wrote:
>> When building the hypervisor with -Og, we encounter the following error:
> 
> Is this with GCC 12 as well?

Yes. If my memory serves me correctly this particular one occurs with both GCC 
11 and 12.

>> 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>
>> ---
>> See previous discussion here
>> https://lists.xenproject.org/archives/html/xen-devel/2022-10/msg00741.html
>> ---
>>   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 4f9d4f9d8867..18b350734a8e 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -1944,7 +1944,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;
> 
> NIT: I would add "Keep the compiler happy with -Og"
> 
> I am happy to add it while committing if you agree.

Yes, please do. Thanks.

> Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>
> 
> Cheers,
> 
> -- 
> Julien Grall



 


Rackspace

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