From: Roel Kluin Date: Wed, 11 Aug 2010 01:01:17 +0000 (-0700) Subject: dc395x: decrease iteration for tag_number of max_command in start_scsi() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d8187b945aa4ed9ea298518e3dac691ea09724e5;p=linux-beck.git 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. Signed-off-by: Roel Kluin Cc: Oliver Neukum Cc: James Bottomley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index bd977be7544e..54f50b07dac7 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -1597,7 +1597,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++; }