kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] scsi: missing braces in scsi_extd_sense_format()
@ 2014-11-05 20:38 Dan Carpenter
  2014-11-06  6:39 ` Christoph Hellwig
  2014-11-06  6:53 ` Hannes Reinecke
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2014-11-05 20:38 UTC (permalink / raw)
  To: James E.J. Bottomley, Hannes Reinecke; +Cc: linux-scsi, kernel-janitors

There were missing curly braces so we always return the first
additional2[] string.

Fixes: 7046d2fa6dbd ('scsi: use sdev as argument for sense code printing')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index a1a7fca..0cf43f6 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -1282,9 +1282,10 @@ scsi_extd_sense_format(unsigned char asc, unsigned char ascq, const char **fmt)
 	for (i = 0; additional2[i].fmt; i++) {
 		if (additional2[i].code1 = asc &&
 		    ascq >= additional2[i].code2_min &&
-		    ascq <= additional2[i].code2_max)
+		    ascq <= additional2[i].code2_max) {
 			*fmt = additional2[i].fmt;
 			return additional2[i].str;
+		}
 	}
 #endif
 	return NULL;

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

* Re: [patch] scsi: missing braces in scsi_extd_sense_format()
  2014-11-05 20:38 [patch] scsi: missing braces in scsi_extd_sense_format() Dan Carpenter
@ 2014-11-06  6:39 ` Christoph Hellwig
  2014-11-06  6:53 ` Hannes Reinecke
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2014-11-06  6:39 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: James E.J. Bottomley, Hannes Reinecke, linux-scsi,
	kernel-janitors

On Wed, Nov 05, 2014 at 11:38:37PM +0300, Dan Carpenter wrote:
> There were missing curly braces so we always return the first
> additional2[] string.
> 
> Fixes: 7046d2fa6dbd ('scsi: use sdev as argument for sense code printing')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks! 

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

* Re: [patch] scsi: missing braces in scsi_extd_sense_format()
  2014-11-05 20:38 [patch] scsi: missing braces in scsi_extd_sense_format() Dan Carpenter
  2014-11-06  6:39 ` Christoph Hellwig
@ 2014-11-06  6:53 ` Hannes Reinecke
  1 sibling, 0 replies; 3+ messages in thread
From: Hannes Reinecke @ 2014-11-06  6:53 UTC (permalink / raw)
  To: Dan Carpenter, James E.J. Bottomley
  Cc: linux-scsi, kernel-janitors, Christoph Hellwig

On 11/05/2014 09:38 PM, Dan Carpenter wrote:
> There were missing curly braces so we always return the first
> additional2[] string.
> 
> Fixes: 7046d2fa6dbd ('scsi: use sdev as argument for sense code printing')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
> index a1a7fca..0cf43f6 100644
> --- a/drivers/scsi/constants.c
> +++ b/drivers/scsi/constants.c
> @@ -1282,9 +1282,10 @@ scsi_extd_sense_format(unsigned char asc, unsigned char ascq, const char **fmt)
>  	for (i = 0; additional2[i].fmt; i++) {
>  		if (additional2[i].code1 = asc &&
>  		    ascq >= additional2[i].code2_min &&
> -		    ascq <= additional2[i].code2_max)
> +		    ascq <= additional2[i].code2_max) {
>  			*fmt = additional2[i].fmt;
>  			return additional2[i].str;
> +		}
>  	}
>  #endif
>  	return NULL;
> 
D'oh.

Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 21284 (AG Nürnberg)
--
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] 3+ messages in thread

end of thread, other threads:[~2014-11-06  6:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-05 20:38 [patch] scsi: missing braces in scsi_extd_sense_format() Dan Carpenter
2014-11-06  6:39 ` Christoph Hellwig
2014-11-06  6:53 ` Hannes Reinecke

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