Skip to contentSkip to conversation

wd33c93 updates

PATCH James Bottomley 2 participants 3 messages Feb 24, 2003 1 message not in the archive SCSI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 4 lines · Christoph Hellwig

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 =====

drivers/scsi/wd33c93.c +2 -36
@@ -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[] = {
#2 lore raw

Am Montag, 24. Februar 2003 16:40 schrieb James Bottomley:

Quoted 9 lines · Christoph Hellwig
Quoted 4 lines

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.

Hi,

in all cases? And in which kernel versions?

Regards
Oliver

#3 lore raw
Quoted 7 lines · Oliver Neukum

Am Montag, 24. Februar 2003 16:40 schrieb James Bottomley:

Quoted 6 lines · Christoph Hellwig
Quoted 4 lines

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.

Quoted 7 lines
Quoted 3 lines

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.

Hi,

in all cases? And in which kernel versions?

Well, definitely all of 2.5 and most of 2.4. I think it was done early on in 2.3 actually as part of the Eric Youngdale clean ups, but I don't have the exact version to hand.

James