Skip to contentSkip to conversation

x86/resctrl: fix the uninitialized variable warning

PATCH Superseded Moger, Babu 3 participants 4 messages Nov 28, 2018 – Dec 18, 2018

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Moger, Babu

author reviewer
#0 lore raw

PATCH 1/1 x86/resctrl: fix the uninitialized variable warning

Fix the compiler warning caused by a recent change.

Fixes a36c5ff560fb ("x86/resctrl: Bring cbm_validate() into the resource structure")
---
 arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/resctrl/ctrlmondata.c +1 -1
index 03ee13235a45..2477cb196735 100644
@@ -202,7 +202,7 @@ int parse_cbm(struct rdt_parse_data *data, struct rdt_resource *r,
 	      struct rdt_domain *d)
 {
 	struct rdtgroup *rdtgrp = data->rdtgrp;
-	u32 cbm_val;
+	u32 cbm_val = 0;
 
 	if (d->have_new_ctrl) {
 		rdt_last_cmd_printf("Duplicate domain %d\n", d->id);
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 1 line · Babu

Fix the compiler warning caused by a recent change.

Now take your time machine, send yourself 6 months into the future, look at that commit message and try to remember what it was fixing. Can you?

I can't.

IOW, please summarize what smatch - the static checker not the compiler
- was complaining about and why this is a good fix.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
author reviewer
#2 lore raw

Boris,

Quoted 12 lines

-----Original Message-----
From: Borislav Petkov <[email protected]>
Sent: Wednesday, November 28, 2018 2:30 PM
To: Moger, Babu <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] x86/resctrl: fix the uninitialized variable warning

Quoted 1 line · Babu

Fix the compiler warning caused by a recent change.

Quoted 7 lines

Now take your time machine, send yourself 6 months into the future, look at that commit message and try to remember what it was fixing. Can you?

I can't.

IOW, please summarize what smatch - the static checker not the compiler
- was complaining about and why this is a good fix.

Yes. Forgot to mention. Sent v2. I will mention about static checker in v3.

Quoted 8 lines

Thx.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

#3 lore raw

[tip:x86/cache] x86/resctrl: Fix the uninitialized variable warning

In reply to Moger, Babu
x86/resctrl: Fix the uninitialized variable warning
Commit-ID:  0858ea05ee8b424e7776237b06bdfc7d6de0e014
Gitweb:     https://git.kernel.org/tip/0858ea05ee8b424e7776237b06bdfc7d6de0e014
Author:     MogerBabu <[email protected]>
AuthorDate: Wed, 28 Nov 2018 20:15:02 +0000
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Tue, 18 Dec 2018 12:47:07 +0100

x86/resctrl: Fix the uninitialized variable warning

Fix the compiler warning caused by a recent change.

---
 arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/resctrl/ctrlmondata.c +1 -1
index 3b943ace786c..4b47ae76cccb 100644
@@ -202,7 +202,7 @@ int parse_cbm(struct rdt_parse_data *data, struct rdt_resource *r,
 	      struct rdt_domain *d)
 {
 	struct rdtgroup *rdtgrp = data->rdtgrp;
-	u32 cbm_val;
+	u32 cbm_val = 0;
 
 	if (d->have_new_ctrl) {
 		rdt_last_cmd_printf("Duplicate domain %d\n", d->id);