All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch v2] mpt2sas: issue reset is never uninitialized
@ 2014-12-04 10:56 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2014-12-04 10:56 UTC (permalink / raw)
  To: Nagalakshmi Nandigama
  Cc: Praveen Krishnamoorthy, Sreekanth Reddy, Abhijit Mahajan,
	James E.J. Bottomley, MPT-FusionLinux.pdl, linux-scsi,
	kernel-janitors, Julia Lawall

The "issue_reset" variable can be used uninitialized.  It should be set
to false at the start.

Also I cleaned up the types by using bool.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: style fix

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 58e4521..3fb01d1 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -3236,7 +3236,7 @@ mpt2sas_base_sas_iounit_control(struct MPT2SAS_ADAPTER *ioc,
 	u16 smid;
 	u32 ioc_state;
 	unsigned long timeleft;
-	u8 issue_reset;
+	bool issue_reset = false;
 	int rc;
 	void *request;
 	u16 wait_state_count;
@@ -3300,7 +3300,7 @@ mpt2sas_base_sas_iounit_control(struct MPT2SAS_ADAPTER *ioc,
 		_debug_dump_mf(mpi_request,
 		    sizeof(Mpi2SasIoUnitControlRequest_t)/4);
 		if (!(ioc->base_cmds.status & MPT2_CMD_RESET))
-			issue_reset = 1;
+			issue_reset = true;
 		goto issue_host_reset;
 	}
 	if (ioc->base_cmds.status & MPT2_CMD_REPLY_VALID)
@@ -3341,7 +3341,7 @@ mpt2sas_base_scsi_enclosure_processor(struct MPT2SAS_ADAPTER *ioc,
 	u16 smid;
 	u32 ioc_state;
 	unsigned long timeleft;
-	u8 issue_reset;
+	bool issue_reset = false;
 	int rc;
 	void *request;
 	u16 wait_state_count;
@@ -3398,7 +3398,7 @@ mpt2sas_base_scsi_enclosure_processor(struct MPT2SAS_ADAPTER *ioc,
 		_debug_dump_mf(mpi_request,
 		    sizeof(Mpi2SepRequest_t)/4);
 		if (!(ioc->base_cmds.status & MPT2_CMD_RESET))
-			issue_reset = 1;
+			issue_reset = true;
 		goto issue_host_reset;
 	}
 	if (ioc->base_cmds.status & MPT2_CMD_REPLY_VALID)

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

end of thread, other threads:[~2014-12-30 12:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-04 10:56 [patch v2] mpt2sas: issue reset is never uninitialized Dan Carpenter
2014-12-04 10:56 ` Dan Carpenter
2014-12-10  6:52 ` Sreekanth Reddy
2014-12-10  6:59   ` Sreekanth Reddy
2014-12-30 12:55 ` Christoph Hellwig
2014-12-30 12:55   ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.