From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756841AbdEKXxx (ORCPT ); Thu, 11 May 2017 19:53:53 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35930 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756797AbdEKXxv (ORCPT ); Thu, 11 May 2017 19:53:51 -0400 From: Karim Eshapa To: sfrench@samba.org Cc: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, Karim Eshapa Subject: [PATCH] fs: cifs: transport: Use time_after for time comparison Date: Fri, 12 May 2017 01:53:38 +0200 Message-Id: <1494546818-5544-1-git-send-email-karim.eshapa@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use time_after kernel macro for time comparison that has safety check. Signed-off-by: Karim Eshapa --- fs/cifs/transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 4d64b5b..a7f5168 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -94,7 +94,7 @@ DeleteMidQEntry(struct mid_q_entry *midEntry) now = jiffies; /* commands taking longer than one second are indications that 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)) { pr_debug(" CIFS slow rsp: cmd %d mid %llu", midEntry->command, midEntry->mid); -- 2.7.4