public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: James.Bottomley@SteelEye.com
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH] 2.6.10 include/scsi/scsi.h and drivers/scsi/constants.h
Date: Mon, 31 Jan 2005 09:43:03 -0800	[thread overview]
Message-ID: <1107193383.11517.12.camel@localhost.localdomain> (raw)

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;
 	}
     



             reply	other threads:[~2005-01-31 17:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-31 17:43 Joe Perches [this message]
2005-02-01  0:15 ` [PATCH] 2.6.10 include/scsi/scsi.h and drivers/scsi/constants.h Douglas Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1107193383.11517.12.camel@localhost.localdomain \
    --to=joe@perches.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox