linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hvc_xen: avoid uninitialized variable warning
@ 2015-05-28  8:28 Jan Beulich
  2015-05-28 10:38 ` David Vrabel
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2015-05-28  8:28 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: David Vrabel, Boris Ostrovsky, Konrad Rzeszutek Wilk, linux-kernel

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.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 drivers/tty/hvc/hvc_xen.c         |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

--- 4.1-rc5/drivers/tty/hvc/hvc_xen.c
+++ 4.1-rc5-xen-unint-warnings/drivers/tty/hvc/hvc_xen.c
@@ -302,7 +302,7 @@ static int xen_initial_domain_console_in
 static void xen_console_update_evtchn(struct xencons_info *info)
 {
 	if (xen_hvm_domain()) {
-		uint64_t v;
+		uint64_t v = 0;
 		int err;
 
 		err = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v);




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] hvc_xen: avoid uninitialized variable warning
  2015-05-28  8:28 [PATCH] hvc_xen: avoid uninitialized variable warning Jan Beulich
@ 2015-05-28 10:38 ` David Vrabel
  0 siblings, 0 replies; 2+ messages in thread
From: David Vrabel @ 2015-05-28 10:38 UTC (permalink / raw)
  To: Jan Beulich, linuxppc-dev
  Cc: Boris Ostrovsky, Konrad Rzeszutek Wilk, linux-kernel

On 28/05/15 09:28, Jan Beulich wrote:
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-28 10:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-28  8:28 [PATCH] hvc_xen: avoid uninitialized variable warning Jan Beulich
2015-05-28 10:38 ` David Vrabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).