drivers: net: wimax: i2400m: i2400m-usb: Use time_after for time comparison
authorKarim Eshapa <karim.eshapa@gmail.com>
Tue, 9 May 2017 00:06:50 +0000 (02:06 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 May 2017 13:40:33 +0000 (09:40 -0400)
Use time_after() for time comparison with the new fix.

Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wimax/i2400m/i2400m-usb.h

index 649ecad6844c73baa58a9e8b0e1850b9fdb88b36..eff4f464a23e14e92a7f57e77c08a6e1e6c8878c 100644 (file)
@@ -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 + timeframe)) {
                edc->errorcount = 1;
                edc->timestart = now;
        } else if (++edc->errorcount > max_err) {