aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/paride/pcd.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2010-03-11 17:09:47 -0500
committerJens Axboe <jens.axboe@oracle.com>2010-03-12 04:03:42 -0500
commitc12ec0a2d94001003dfb929ce14c287fca0522b0 (patch)
treefd901e7114ddc7e1c7905ad768b982b6ff17ef66 /drivers/block/paride/pcd.c
parent39ad2bbb5900d1bc9ae8f06cebb4cb2529d9e42e (diff)
paride: fix off-by-one test
With `while (j++ < PX_SPIN)' j reaches PX_SPIN + 1 after the loop. This is probably unlikely to produce a problem. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block/paride/pcd.c')
-rw-r--r--drivers/block/paride/pcd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
index 8866ca369d5e..71acf4e53356 100644
--- a/drivers/block/paride/pcd.c
+++ b/drivers/block/paride/pcd.c
@@ -341,11 +341,11 @@ static int pcd_wait(struct pcd_unit *cd, int go, int stop, char *fun, char *msg)
341 && (j++ < PCD_SPIN)) 341 && (j++ < PCD_SPIN))
342 udelay(PCD_DELAY); 342 udelay(PCD_DELAY);
343 343
344 if ((r & (IDE_ERR & stop)) || (j >= PCD_SPIN)) { 344 if ((r & (IDE_ERR & stop)) || (j > PCD_SPIN)) {
345 s = read_reg(cd, 7); 345 s = read_reg(cd, 7);
346 e = read_reg(cd, 1); 346 e = read_reg(cd, 1);
347 p = read_reg(cd, 2); 347 p = read_reg(cd, 2);
348 if (j >= PCD_SPIN) 348 if (j > PCD_SPIN)
349 e |= 0x100; 349 e |= 0x100;
350 if (fun) 350 if (fun)
351 printk("%s: %s %s: alt=0x%x stat=0x%x err=0x%x" 351 printk("%s: %s %s: alt=0x%x stat=0x%x err=0x%x"