[PATCH] drivers/scsi/*: use time_after() and friends
They deal with wrapping correctly and are nicer to read. Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: James Bottomley <James.Bottomley@steeleye.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
9bae1ff3e7
commit
60c904ae5b
@@ -49,6 +49,7 @@ static const char * osst_version = "0.99.4";
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/dma.h>
|
||||
#include <asm/system.h>
|
||||
@@ -856,7 +857,7 @@ static int osst_wait_frame(struct osst_tape * STp, struct osst_request ** aSRpnt
|
||||
) && result >= 0)
|
||||
{
|
||||
#if DEBUG
|
||||
if (debugging || jiffies - startwait >= 2*HZ/OSST_POLL_PER_SEC)
|
||||
if (debugging || time_after_eq(jiffies, startwait + 2*HZ/OSST_POLL_PER_SEC))
|
||||
printk (OSST_DEB_MSG
|
||||
"%s:D: Succ wait f fr %i (>%i): %i-%i %i (%i): %3li.%li s\n",
|
||||
name, curr, curr+minlast, STp->first_frame_position,
|
||||
@@ -867,7 +868,7 @@ static int osst_wait_frame(struct osst_tape * STp, struct osst_request ** aSRpnt
|
||||
return 0;
|
||||
}
|
||||
#if DEBUG
|
||||
if (jiffies - startwait >= 2*HZ/OSST_POLL_PER_SEC && notyetprinted)
|
||||
if (time_after_eq(jiffies, startwait + 2*HZ/OSST_POLL_PER_SEC) && notyetprinted)
|
||||
{
|
||||
printk (OSST_DEB_MSG "%s:D: Wait for frame %i (>%i): %i-%i %i (%i)\n",
|
||||
name, curr, curr+minlast, STp->first_frame_position,
|
||||
|
Reference in New Issue
Block a user