RE: [patch] qla4xxx: initialize some variables for gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>-----Original Message-----
>From: Dan Carpenter [mailto:error27@xxxxxxxxx]
>Sent: Saturday, August 14, 2010 2:34 AM
>To: Ravi Anand
>Cc: Vikas Chaudhary; Dept_iscsi_driver; James E.J. Bottomley; Karen
>Higgins; linux-scsi@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; kernel-
>janitors@xxxxxxxxxxxxxxx
>Subject: [patch] qla4xxx: initialize some variables for gcc
>
>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@xxxxxxxxx>
>
>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;

I already submitted patch to fix this warning in following mail thread.
http://marc.info/?l=linux-scsi&m=128152158403853&w=2

��.n��������+%������w��{.n����z�ޗ�����n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�

[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux