From: Adrian Bunk Date: Thu, 5 May 2005 23:16:22 +0000 (-0700) Subject: [PATCH] drivers/scsi/sym53c416.c: fix a wrong check X-Git-Tag: v2.6.12-rc4~30 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6f0b0d016a254ff583fec26f2c9e21c1ae2fdf3;p=linux-2.6 [PATCH] drivers/scsi/sym53c416.c: fix a wrong check The Coverity checker found that this for loop was wrong. This patch changes it to what seems to be intended. Signed-off-by: Adrian Bunk Cc: James Bottomley Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c index f26c3a29e6..ebfddd40ce 100644 --- a/drivers/scsi/sym53c416.c +++ b/drivers/scsi/sym53c416.c @@ -809,7 +809,7 @@ static int sym53c416_host_reset(Scsi_Cmnd *SCpnt) /* printk("sym53c416_reset\n"); */ base = SCpnt->device->host->io_port; /* search scsi_id - fixme, we shouldnt need to iterate for this! */ - for(i = 0; i < host_index && scsi_id != -1; i++) + for(i = 0; i < host_index && scsi_id == -1; i++) if(hosts[i].base == base) scsi_id = hosts[i].scsi_id; outb(RESET_CHIP, base + COMMAND_REG);