Skip to contentSkip to conversation

scsi: missing braces in scsi_extd_sense_format()

PATCH In review Dan Carpenter 3 participants 3 messages Nov 5, 2014 – Nov 6, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: missing braces in scsi_extd_sense_format()

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

Fixes 7046d2fa6dbd ('scsi: use sdev as argument for sense code printing')
drivers/scsi/constants.c +2 -1
index a1a7fca..0cf43f6 100644
@@ -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;
Reviewed-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter
Quoted 13 lines · Dan Carpenter

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

Fixes 7046d2fa6dbd ('scsi: use sdev as argument for sense code printing')
drivers/scsi/constants.c +0 -0
index a1a7fca..0cf43f6 100644
@@ -1282,9 +1282,10 @@ scsi_extd_sense_format(unsigned char asc, unsigned char ascq, const char **fmt)
 	for (i = 0; additional2[i].fmt; i++) {

drivers/scsi/constants.c scsi_extd_sense_format(unsigned char asc, unsigned char ascq, const char **fmt) · line 1291

Quoted 10 lines
drivers/scsi/constants.c +2 -1
 		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.

Cheers,

Hannes

Signature · 8 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html