: aic94xx: fix uninitialized variable warning
PATCH 1/1 : aic94xx: fix uninitialized variable warning
Fixes warning:
drivers/scsi/aic94xx/aic94xx_sds.c: In function ‘asd_process_ctrl_a_user’:drivers/scsi/aic94xx/aic94xx_sds.c:985: error: ‘offs’ may be used uninitialized in this function
drivers/scsi/aic94xx/aic94xx_sds.c +1 -1
@@ -982,7 +982,7 @@ static int asd_process_ctrl_a_user(struct asd_ha_struct *asd_ha, struct asd_flash_dir *flash_dir) {int err, i; -u32 offs, size; +u32 uninitialized_var (offs ), size;struct asd_ll_el *el;struct asd_ctrla_phy_settings *ps;struct asd_ctrla_phy_settings dflt_ps;
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines · Prarit Bhargava
Fixes warning:
drivers/scsi/aic94xx/aic94xx_sds.c: In function ‘asd_process_ctrl_a_user’:drivers/scsi/aic94xx/aic94xx_sds.c:985:
error: ‘offs’ may be used uninitialized in this function
Your mailer has messed this up as it did not declare any character set. This was probably UTF8 or something like that.
drivers/scsi/aic94xx/aic94xx_sds.c static int asd_process_ctrl_a_user(struct asd_ha_struct · line 988
Quoted 13 lines
(quoted diff) +0
-0
b/drivers/scsi/aic94xx/aic94xx_sds.cindex edb43fd..2f1751a 100644drivers/scsi/aic94xx/aic94xx_sds.c +1
-1@@ -982,7 +982,7 @@ static int asd_process_ctrl_a_user(struct asd_ha_struct *asd_ha, struct asd_flash_dir *flash_dir) {int err, i; -u32 offs, size; +u32 uninitialized_var (offs ), size;struct asd_ll_el *el;struct asd_ctrla_phy_settings *ps;struct asd_ctrla_phy_settings dflt_ps;
I would vote for putting the declarations if different lines if one of them gets initialized or otherwise treated specially as it is otherwise hardly readable.
Eike
Quoted 11 lines
Quoted 11 lines
(quoted diff) +0
-0
b/drivers/scsi/aic94xx/aic94xx_sds.cindex edb43fd..2f1751a 100644drivers/scsi/aic94xx/aic94xx_sds.c +0
-1@@ -982,7 +982,7 @@ static int asd_process_ctrl_a_user(struct asd_ha_struct *asd_ha, struct asd_flash_dir *flash_dir) {int err, i; -u32 offs, size;
Quoted 9 lines
drivers/scsi/aic94xx/aic94xx_sds.c static int asd_process_ctrl_a_user(struct asd_ha_struct · line 988
Quoted 4 lines
drivers/scsi/aic94xx/aic94xx_sds.c +1
-0+u32 uninitialized_var (offs ), size;struct asd_ll_el *el;struct asd_ctrla_phy_settings *ps;struct asd_ctrla_phy_settings dflt_ps;I would vote for putting the declarations if different lines if one of them gets initialized or otherwise treated specially as it is otherwise hardly readable.
Thanks Eike,
New patch.
Fixes make -j24 CONFIG_DEBUG_SECTION_MISMATCH=y warning:
drivers/scsi/aic94xx/aic94xx_sds.c: In function "asd_process_ctrl_a_user":drivers/scsi/aic94xx/aic94xx_sds.c:984: error: "offs" may be used uninitialized in this function
Fix an uninitialized variable warning. A return value is checked elsewhere in the function so this is safe to do.
drivers/scsi/aic94xx/aic94xx_sds.c +2 -1
@@ -982,7 +982,8 @@ static int asd_process_ctrl_a_user(struct asd_ha_struct *asd_ha, struct asd_flash_dir *flash_dir) {int err, i; -u32 offs, size; +u32 uninitialized_var (offs ); +u32 size;struct asd_ll_el *el;struct asd_ctrla_phy_settings *ps;struct asd_ctrla_phy_settings dflt_ps;