netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Que <sque@chromium.org>
To: jacmet@sunsite.dk, netdev@vger.kernel.org
Cc: msb@chromium.org, Simon Que <sque@chromium.org>
Subject: [PATCH] net: usb: initialize tmp in dm9601.c to avoid warning
Date: Thu, 17 Jan 2013 11:29:49 -0800	[thread overview]
Message-ID: <1358450989-25205-1-git-send-email-sque@chromium.org> (raw)

In two places, tmp is initialized implicitly by being passed as a
pointer during a function call.  However, this is not obvious to the
compiler, which logs a warning.

Signed-off-by: Simon Que <sque@chromium.org>
---
 drivers/net/usb/dm9601.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index e0433ce..94e716d 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -199,7 +199,7 @@ static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *valu
 	dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0xc : 0x4);
 
 	for (i = 0; i < DM_TIMEOUT; i++) {
-		u8 tmp;
+		u8 tmp = 0;
 
 		udelay(1);
 		ret = dm_read_reg(dev, DM_SHARED_CTRL, &tmp);
@@ -242,7 +242,7 @@ static int dm_write_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 valu
 	dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0x1a : 0x12);
 
 	for (i = 0; i < DM_TIMEOUT; i++) {
-		u8 tmp;
+		u8 tmp = 0;
 
 		udelay(1);
 		ret = dm_read_reg(dev, DM_SHARED_CTRL, &tmp);
-- 
1.7.8.6

             reply	other threads:[~2013-01-17 19:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-17 19:29 Simon Que [this message]
2013-01-17 22:47 ` [PATCH] net: usb: initialize tmp in dm9601.c to avoid warning Peter Korsgaard
2013-01-17 22:54   ` David Miller
2013-01-18  7:37     ` Peter Korsgaard
2013-01-18  8:03       ` David Miller
2013-01-18  8:44         ` Peter Korsgaard
2013-01-18 10:07         ` David Laight
2013-01-18 19:29 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1358450989-25205-1-git-send-email-sque@chromium.org \
    --to=sque@chromium.org \
    --cc=jacmet@sunsite.dk \
    --cc=msb@chromium.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).