linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 13/26] dc395x: decrease iteration for tag_number of max_command in start_scsi()
@ 2010-05-24 19:22 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2010-05-24 19:22 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, akpm, roel.kluin, oliver

From: Roel Kluin <roel.kluin@gmail.com>

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 <roel.kluin@gmail.com>
Cc: Oliver Neukum <oliver@neukum.name>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/scsi/dc395x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/scsi/dc395x.c~dc395x-decrease-iteration-for-tag_number-of-max_command-in-start_scsi drivers/scsi/dc395x.c
--- a/drivers/scsi/dc395x.c~dc395x-decrease-iteration-for-tag_number-of-max_command-in-start_scsi
+++ a/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++;
 		}
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-24 19:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-24 19:22 [patch 13/26] dc395x: decrease iteration for tag_number of max_command in start_scsi() akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).