public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@steeleye.com>
To: Christoph Hellwig <hch@lst.de>
Cc: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] wd33c93 updates
Date: 24 Feb 2003 10:40:12 -0500	[thread overview]
Message-ID: <1046101213.2288.5.camel@mulgrave> (raw)
In-Reply-To: <20030223153007.A9377@lst.de>

On Sun, 2003-02-23 at 09:30, Christoph Hellwig wrote:
> The PC98 folks have some updates in their tree to make the generic
> wd33c93 driver usable in PIO mode, but unfortunately the way they do it
> (include a header specific to their lowlevel driver in wd33c93.c
> conditionally) is rather ugly.

OK much as I dislike looking at driver clean ups, this one stood out. 
We don't need each driver to get the command direction by parsing, the
mid-layer now does it for you.

James

===== drivers/scsi/wd33c93.c 1.8 vs edited =====
--- 1.8/drivers/scsi/wd33c93.c	Sun Feb 23 09:24:23 2003
+++ edited/drivers/scsi/wd33c93.c	Sun Feb 23 13:54:03 2003
@@ -304,44 +304,10 @@
  * will be a DATA_OUT phase with this command, false otherwise.
  * (Thanks to Joerg Dorchain for the research and suggestion.)
  */
-static int
+static inline int
 is_dir_out(Scsi_Cmnd * cmd)
 {
-	switch (cmd->cmnd[0]) {
-	case WRITE_6:
-	case WRITE_10:
-	case WRITE_12:
-	case WRITE_LONG:
-	case WRITE_SAME:
-	case WRITE_BUFFER:
-	case WRITE_VERIFY:
-	case WRITE_VERIFY_12:
-	case COMPARE:
-	case COPY:
-	case COPY_VERIFY:
-	case SEARCH_EQUAL:
-	case SEARCH_HIGH:
-	case SEARCH_LOW:
-	case SEARCH_EQUAL_12:
-	case SEARCH_HIGH_12:
-	case SEARCH_LOW_12:
-	case FORMAT_UNIT:
-	case REASSIGN_BLOCKS:
-	case RESERVE:
-	case MODE_SELECT:
-	case MODE_SELECT_10:
-	case LOG_SELECT:
-	case SEND_DIAGNOSTIC:
-	case CHANGE_DEFINITION:
-	case UPDATE_BLOCK:
-	case SET_WINDOW:
-	case MEDIUM_SCAN:
-	case SEND_VOLUME_TAG:
-	case 0xea:
-		return 1;
-	default:
-		return 0;
-	}
+	return cmd->sc_data_direction == SCSI_DATA_WRITE;
 }
 
 static struct sx_period sx_table[] = {


       reply	other threads:[~2003-02-24 15:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030223153007.A9377@lst.de>
2003-02-24 15:40 ` James Bottomley [this message]
2003-02-24 19:07   ` [PATCH] wd33c93 updates Oliver Neukum
2003-02-24 19:17     ` James Bottomley

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=1046101213.2288.5.camel@mulgrave \
    --to=james.bottomley@steeleye.com \
    --cc=hch@lst.de \
    --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