Skip to contentSkip to conversation

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

PATCH New Roel Kluin 1 participant 1 message Dec 26, 2009

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 dc395x: Decrease iteration for tag_number of max_command in start_scsi()

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.

---
 drivers/scsi/dc395x.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Or maybe we should allow a tag_number of dcb->max_command?

drivers/scsi/dc395x.c +1 -1
index 6c59c02..f476b52 100644
@@ -1596,7 +1596,7 @@ static u8 start_scsi(struct AdapterCtlBlk* acb, struct DeviceCtlBlk* dcb,
 		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++;
 		}