diff --git a/drivers/char/xillybus/xillybus_core.c b/drivers/char/xillybus/xillybus_core.c index 952ef149aba1..7acebc1e6050 100644 --- a/drivers/char/xillybus/xillybus_core.c +++ b/drivers/char/xillybus/xillybus_core.c @@ -694,7 +694,8 @@ static ssize_t xillybus_read(struct file *filp, char __user *userbuf, unsigned long flags; int bytes_done = 0; int no_time_left = 0; - long deadline, left_to_sleep; + unsigned long deadline; + long left_to_sleep; struct xilly_channel *channel = filp->private_data; int empty, reached_eof, exhausted, ready; @@ -938,7 +939,7 @@ static ssize_t xillybus_read(struct file *filp, char __user *userbuf, return -EINTR; } - left_to_sleep = deadline - ((long) jiffies); + left_to_sleep = deadline - jiffies; /* * If our time is out, skip the waiting. We may miss wr_sleepy diff --git a/drivers/char/xillybus/xillyusb.c b/drivers/char/xillybus/xillyusb.c index 9182817c435b..ddd583304504 100644 --- a/drivers/char/xillybus/xillyusb.c +++ b/drivers/char/xillybus/xillyusb.c @@ -1121,12 +1121,13 @@ static int xillyusb_send_opcode(struct xillyusb_dev *xdev, */ static int flush_downstream(struct xillyusb_channel *chan, - long timeout, + unsigned long timeout, bool interruptible) { struct xillyusb_dev *xdev = chan->xdev; int chan_num = chan->chan_idx << 1; - long deadline, left_to_sleep; + unsigned long deadline; + long left_to_sleep; int rc; if (chan->flushed) @@ -1135,7 +1136,8 @@ static int flush_downstream(struct xillyusb_channel *chan, deadline = jiffies + 1 + timeout; if (chan->flushing) { - long cancel_deadline = jiffies + 1 + XILLY_RESPONSE_TIMEOUT; + unsigned long cancel_deadline = + jiffies + 1 + XILLY_RESPONSE_TIMEOUT; chan->canceled = 0; rc = xillyusb_send_opcode(xdev, chan_num, @@ -1146,7 +1148,7 @@ static int flush_downstream(struct xillyusb_channel *chan, /* Ignoring interrupts. Cancellation must be handled */ while (!chan->canceled) { - left_to_sleep = cancel_deadline - ((long)jiffies); + left_to_sleep = cancel_deadline - jiffies; if (left_to_sleep <= 0) { report_io_error(xdev, -EIO); @@ -1196,7 +1198,7 @@ static int flush_downstream(struct xillyusb_channel *chan, } while (chan->flushing) { - left_to_sleep = deadline - ((long)jiffies); + left_to_sleep = deadline - jiffies; if (left_to_sleep <= 0) return -ETIMEDOUT; @@ -1429,7 +1431,8 @@ static ssize_t xillyusb_read(struct file *filp, char __user *userbuf, struct xillyfifo *fifo = chan->in_fifo; int chan_num = (chan->chan_idx << 1) | 1; - long deadline, left_to_sleep; + unsigned long deadline; + long left_to_sleep; int bytes_done = 0; bool sent_set_push = false; int rc; @@ -1458,7 +1461,7 @@ static ssize_t xillyusb_read(struct file *filp, char __user *userbuf, bytes_done += rc; chan->in_consumed_bytes += rc; - left_to_sleep = deadline - ((long)jiffies); + left_to_sleep = deadline - jiffies; /* * Some 32-bit arithmetic that may wrap. Note that