fs: cifs: transport: Use time_after for time comparison

Use time_after kernel macro for time comparison
that has safety check.

Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
Signed-off-by: Steve French <smfrench@gmail.com>
This commit is contained in:
Karim Eshapa 2017-05-12 01:53:38 +02:00 committed by Steve French
parent cd1230070a
commit 4328fea77c

View File

@ -94,7 +94,7 @@ DeleteMidQEntry(struct mid_q_entry *midEntry)
now = jiffies; now = jiffies;
/* commands taking longer than one second are indications that /* commands taking longer than one second are indications that
something is wrong, unless it is quite a slow link or server */ something is wrong, unless it is quite a slow link or server */
if ((now - midEntry->when_alloc) > HZ) { if (time_after(now, midEntry->when_alloc + HZ)) {
if ((cifsFYI & CIFS_TIMER) && (midEntry->command != command)) { if ((cifsFYI & CIFS_TIMER) && (midEntry->command != command)) {
pr_debug(" CIFS slow rsp: cmd %d mid %llu", pr_debug(" CIFS slow rsp: cmd %d mid %llu",
midEntry->command, midEntry->mid); midEntry->command, midEntry->mid);