Re: [PATCH] drivers: net: wimax: i2400m: i2400m-usb: Use time_after for time comparison
From: David Miller
Date: Mon May 08 2017 - 17:26:26 EST
From: Karim Eshapa <karim.eshapa@xxxxxxxxx>
Date: Mon, 8 May 2017 18:58:02 +0200
> diff --git a/drivers/net/wimax/i2400m/i2400m-usb.h b/drivers/net/wimax/i2400m/i2400m-usb.h
> index 649ecad..6fc941c 100644
> --- a/drivers/net/wimax/i2400m/i2400m-usb.h
> +++ b/drivers/net/wimax/i2400m/i2400m-usb.h
> @@ -131,7 +131,7 @@ static inline int edc_inc(struct edc *edc, u16 max_err, u16 timeframe)
> unsigned long now;
>
> now = jiffies;
> - if (now - edc->timestart > timeframe) {
> + if (time_after(now - edc->timestart, (unsigned long)timeframe)) {
This is far from correct.
time_after() compares two "jiffies" timestamp values. The second
argument here is not a jiffies timestamp value.