Skip to contentSkip to conversation

xenbus: avoid uninitialized variable warning

PATCH Applied Jan Beulich 2 participants 2 messages May 28, 2015 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xenbus: avoid uninitialized variable warning

Older compilers don't recognize that "v" can't be used uninitialized; other code using hvm_get_parameter() zeros the value too, so follow suit here.

---
 drivers/xen/xenbus/xenbus_probe.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/xen/xenbus/xenbus_probe.c +1 -1
@@ -742,7 +742,7 @@ static int xenbus_resume_cb(struct notif
 	int err = 0;
 
 	if (xen_hvm_domain()) {
-		uint64_t v;
+		uint64_t v = 0;
 
 		err = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN, &v);
 		if (!err && v)
Applied
#1 lore raw
Quoted 3 lines · Jan Beulich

Older compilers don't recognize that "v" can't be used uninitialized; other code using hvm_get_parameter() zeros the value too, so follow suit here.

Applied to for-linus-4.2, thanks.

David