public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.6.10 include/scsi/scsi.h and drivers/scsi/constants.h
@ 2005-01-31 17:43 Joe Perches
  2005-02-01  0:15 ` Douglas Gilbert
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2005-01-31 17:43 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi

Remove unnecessary ";" from #define and use sense_ macros

--- include/scsi/scsi.h~	2004-12-29 18:58:36.000000000 -0800
+++ include/scsi/scsi.h	2005-01-31 09:07:16.000000000 -0800
@@ -356,7 +356,7 @@
 
 #define sense_class(sense)  (((sense) >> 4) & 0x7)
 #define sense_error(sense)  ((sense) & 0xf)
-#define sense_valid(sense)  ((sense) & 0x80);
+#define sense_valid(sense)  ((sense) & 0x80)
 
 
 #define IDENTIFY_BASE       0x80
--- drivers/scsi/constants.c~	2004-10-18 14:54:39.000000000 -0700
+++ drivers/scsi/constants.c	2005-01-31 09:06:51.000000000 -0800
@@ -924,17 +924,17 @@
 		     const unsigned char *sense_buffer,
 		     struct request *req)
 {
-	int s, sense_class, valid, code, info;
+	int s, class, valid, code, info;
 	const char *error = NULL;
 	unsigned char asc, ascq;
 	const char *sense_txt;
 	const char *name = req->rq_disk ? req->rq_disk->disk_name : devclass;
     
-	sense_class = (sense_buffer[0] >> 4) & 0x07;
-	code = sense_buffer[0] & 0xf;
-	valid = sense_buffer[0] & 0x80;
+	class = sense_class(sense_buffer[0]);
+	code = sense_error(sense_buffer[0]);
+	valid = sense_valid(sense_buffer[0]);
     
-	if (sense_class == 7) {	/* extended sense data */
+	if (class == 7) {	/* extended sense data */
 		s = sense_buffer[7] + 8;
 		if (s > SCSI_SENSE_BUFFERSIZE)
 			s = SCSI_SENSE_BUFFERSIZE;
@@ -1002,7 +1002,7 @@
 			       sense_buffer[0], sense_buffer[2]);
 
 		printk("Non-extended sense class %d code 0x%0x\n",
-		       sense_class, code);
+		       class, code);
 		s = 4;
 	}
     



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

end of thread, other threads:[~2005-02-01  7:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-31 17:43 [PATCH] 2.6.10 include/scsi/scsi.h and drivers/scsi/constants.h Joe Perches
2005-02-01  0:15 ` Douglas Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox