From: Dan Carpenter <error27@gmail.com>
To: Ravi Anand <ravi.anand@qlogic.com>
Cc: Vikas Chaudhary <vikas.chaudhary@qlogic.com>,
iscsi-driver@qlogic.com,
"James E.J. Bottomley" <James.Bottomley@suse.de>,
Karen Higgins <karen.higgins@qlogic.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [patch] qla4xxx: initialize some variables for gcc
Date: Fri, 13 Aug 2010 23:03:50 +0200 [thread overview]
Message-ID: <20100813210350.GT645@bicker> (raw)
Gcc complains because these variables aren't initialized.
drivers/scsi/qla4xxx/ql4_nx.c: In function ‘qla4_8xxx_get_flash_info’:
drivers/scsi/qla4xxx/ql4_nx.c:1952: warning: ‘fid’ may be used uninitialized in this function
drivers/scsi/qla4xxx/ql4_nx.c:1952: note: ‘fid’ was declared here
drivers/scsi/qla4xxx/ql4_nx.c:1952: warning: ‘mid’ may be used uninitialized in this function
drivers/scsi/qla4xxx/ql4_nx.c:1952: note: ‘mid’ was declared here
It's not a big deal. We only print the uninitialized value on error
paths when debugging is enabled. Still it's nice to clean it up and to
stop gcc from grumbling.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index 3e119ae..e443fa6 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -1949,7 +1949,8 @@ qla4_8xxx_get_fdt_info(struct scsi_qla_host *ha)
uint16_t cnt, chksum;
uint16_t *wptr;
struct qla_fdt_layout *fdt;
- uint16_t mid, fid;
+ uint16_t mid = -1;
+ uint16_t fid = -1;
struct ql82xx_hw_data *hw = &ha->hw;
hw->flash_conf_off = FARX_ACCESS_FLASH_CONF;
next reply other threads:[~2010-08-13 21:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-13 21:03 Dan Carpenter [this message]
2010-08-14 2:40 ` [patch] qla4xxx: initialize some variables for gcc Vikas Chaudhary
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=20100813210350.GT645@bicker \
--to=error27@gmail.com \
--cc=James.Bottomley@suse.de \
--cc=iscsi-driver@qlogic.com \
--cc=karen.higgins@qlogic.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=ravi.anand@qlogic.com \
--cc=vikas.chaudhary@qlogic.com \
/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