From patchwork Mon Jul 10 15:05:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 9833219 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BB6B160318 for ; Mon, 10 Jul 2017 15:06:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A91C826E3E for ; Mon, 10 Jul 2017 15:06:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BDEF28564; Mon, 10 Jul 2017 15:06:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 164CE26E3E for ; Mon, 10 Jul 2017 15:06:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753567AbdGJPGE (ORCPT ); Mon, 10 Jul 2017 11:06:04 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:40369 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753233AbdGJPGE (ORCPT ); Mon, 10 Jul 2017 11:06:04 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 10 Jul 2017 18:05:59 +0300 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [10.7.2.17]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v6AF5xqU015659; Mon, 10 Jul 2017 18:05:59 +0300 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [127.0.0.1]) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8) with ESMTP id v6AF5xcO029102; Mon, 10 Jul 2017 18:05:59 +0300 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id v6AF5xF0029101; Mon, 10 Jul 2017 18:05:59 +0300 From: Yishai Hadas To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, yishaih@mellanox.com, maorg@mellanox.com, majd@mellanox.com Subject: [PATCH V1 rdma-core 1/5] utils: Add timespec compare utility Date: Mon, 10 Jul 2017 18:05:33 +0300 Message-Id: <1499699137-29037-2-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1499699137-29037-1-git-send-email-yishaih@mellanox.com> References: <1499699137-29037-1-git-send-email-yishaih@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Maor Gottlieb Move ts_cmp from srp_daemon.h to util.h, to be used from another place in a downstream patch. Signed-off-by: Maor Gottlieb Reviewed-by: Yishai Hadas --- srp_daemon/srp_daemon.h | 7 +------ util/util.h | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/srp_daemon/srp_daemon.h b/srp_daemon/srp_daemon.h index 026db41..5d268ed 100644 --- a/srp_daemon/srp_daemon.h +++ b/srp_daemon/srp_daemon.h @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include /* __be16, __be32 and __be64 */ @@ -47,12 +48,6 @@ #include "config.h" #include "srp_ib_types.h" -/* a CMP b. See also the BSD macro timercmp(). */ -#define ts_cmp(a, b, CMP) \ - (((a)->tv_sec == (b)->tv_sec) ? \ - ((a)->tv_nsec CMP (b)->tv_nsec) : \ - ((a)->tv_sec CMP (b)->tv_sec)) - #define SRP_CATAS_ERR SIGUSR1 enum { diff --git a/util/util.h b/util/util.h index ed4ffe8..c3e5955 100644 --- a/util/util.h +++ b/util/util.h @@ -10,4 +10,10 @@ (rc < len && rc >= 0); \ }) +/* a CMP b. See also the BSD macro timercmp(). */ +#define ts_cmp(a, b, CMP) \ + (((a)->tv_sec == (b)->tv_sec) ? \ + ((a)->tv_nsec CMP (b)->tv_nsec) : \ + ((a)->tv_sec CMP (b)->tv_sec)) + #endif