linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] mpt2sas: issue reset is not uninitialized
@ 2014-12-03 10:09 Dan Carpenter
  2014-12-03 10:36 ` Julia Lawall
  2014-12-03 14:14 ` walter harms
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2014-12-03 10:09 UTC (permalink / raw)
  To: Nagalakshmi Nandigama
  Cc: Praveen Krishnamoorthy, Sreekanth Reddy, Abhijit Mahajan,
	James E.J. Bottomley, MPT-FusionLinux.pdl, linux-scsi,
	kernel-janitors

The issue_reset variables were never set to zero.  This bug was found
with static analysis.

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

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 58e4521..98bd546 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 = 0;
 	int rc;
 	void *request;
 	u16 wait_state_count;
@@ -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 = 0;
 	int rc;
 	void *request;
 	u16 wait_state_count;

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

* Re: [patch] mpt2sas: issue reset is not uninitialized
  2014-12-03 10:09 [patch] mpt2sas: issue reset is not uninitialized Dan Carpenter
@ 2014-12-03 10:36 ` Julia Lawall
  2014-12-03 11:03   ` Dan Carpenter
  2014-12-03 14:14 ` walter harms
  1 sibling, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2014-12-03 10:36 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Nagalakshmi Nandigama, Praveen Krishnamoorthy, Sreekanth Reddy,
	Abhijit Mahajan, James E.J. Bottomley, MPT-FusionLinux.pdl,
	linux-scsi, kernel-janitors, quentin.lambert

On Wed, 3 Dec 2014, Dan Carpenter wrote:

> The issue_reset variables were never set to zero.  This bug was found
> with static analysis.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
> index 58e4521..98bd546 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 = 0;

Why not false if it is going to be a boolean?

julia

>  	int rc;
>  	void *request;
>  	u16 wait_state_count;
> @@ -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 = 0;
>  	int rc;
>  	void *request;
>  	u16 wait_state_count;
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [patch] mpt2sas: issue reset is not uninitialized
  2014-12-03 10:36 ` Julia Lawall
@ 2014-12-03 11:03   ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2014-12-03 11:03 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Nagalakshmi Nandigama, Praveen Krishnamoorthy, Sreekanth Reddy,
	Abhijit Mahajan, James E.J. Bottomley, MPT-FusionLinux.pdl,
	linux-scsi, kernel-janitors, quentin.lambert

On Wed, Dec 03, 2014 at 11:36:20AM +0100, Julia Lawall wrote:
> On Wed, 3 Dec 2014, Dan Carpenter wrote:
> 
> > The issue_reset variables were never set to zero.  This bug was found
> > with static analysis.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
> > index 58e4521..98bd546 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 = 0;
> 
> Why not false if it is going to be a boolean?
> 

Good point.  I'll send a v2 for these tomorrow.

regards,
dan carpenter


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

* Re: [patch] mpt2sas: issue reset is not uninitialized
  2014-12-03 10:09 [patch] mpt2sas: issue reset is not uninitialized Dan Carpenter
  2014-12-03 10:36 ` Julia Lawall
@ 2014-12-03 14:14 ` walter harms
  2014-12-03 14:18   ` Dan Carpenter
  1 sibling, 1 reply; 5+ messages in thread
From: walter harms @ 2014-12-03 14:14 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-scsi, kernel-janitors



Am 03.12.2014 11:09, schrieb Dan Carpenter:
> The issue_reset variables were never set to zero.  This bug was found
> with static analysis.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
> index 58e4521..98bd546 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 = 0;
>  	int rc;
>  	void *request;
>  	u16 wait_state_count;
> @@ -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 = 0;
>  	int rc;
>  	void *request;
>  	u16 wait_state_count;


hi Dan,
just a minor question:

did you forget to mention that you also changed from u8 to bool or was this unintentional ?

re,
 wh

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

* Re: [patch] mpt2sas: issue reset is not uninitialized
  2014-12-03 14:14 ` walter harms
@ 2014-12-03 14:18   ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2014-12-03 14:18 UTC (permalink / raw)
  To: walter harms; +Cc: linux-scsi, kernel-janitors

On Wed, Dec 03, 2014 at 03:14:08PM +0100, walter harms wrote:
> hi Dan,
> just a minor question:
> 
> did you forget to mention that you also changed from u8 to bool or was this unintentional ?
> 

That's a trivial thing and I didn't think it was worth mentioning.

regards,
dan carpenter


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

end of thread, other threads:[~2014-12-03 14:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-03 10:09 [patch] mpt2sas: issue reset is not uninitialized Dan Carpenter
2014-12-03 10:36 ` Julia Lawall
2014-12-03 11:03   ` Dan Carpenter
2014-12-03 14:14 ` walter harms
2014-12-03 14:18   ` Dan Carpenter

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).