Skip to contentSkip to conversation

dc395x: decrease iteration for tag_number of max_command in start_scsi()

PATCH In review [email protected] 1 participant 1 message May 24, 2010

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

PATCH 13/26 dc395x: decrease iteration for tag_number of max_command in start_scsi()

From: Roel Kluin <[email protected]>

The tag_number reaches dcb->max_command + 1 after the loop, but when the tag_number equals dcb->max_command an error message is already issued. The last iteration therefore appears obsolete.

Cc Oliver Neukum <[email protected]>
Cc James Bottomley <[email protected]>

---

 drivers/scsi/dc395x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/dc395x.c renamed from drivers/scsi/dc395x.c~dc395x-decrease-iteration-for-tag_number-of-max_command-in-start_scsi +1 -1
diff -puN drivers/scsi/dc395x.c~dc395x-decrease-iteration-for-tag_number-of-max_command-in-start_scsi drivers/scsi/dc395x.c
@@ -1597,7 +1597,7 @@ static u8 start_scsi(struct AdapterCtlBl
 		u32 tag_mask = 1;
 		u8 tag_number = 0;
 		while (tag_mask & dcb->tag_mask
-		       && tag_number <= dcb->max_command) {
+		       && tag_number < dcb->max_command) {
 			tag_mask = tag_mask << 1;
 			tag_number++;
 		}

_