From patchwork Thu Feb 9 21:53:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 9565567 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 7108D60216 for ; Thu, 9 Feb 2017 21:54:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 638542854A for ; Thu, 9 Feb 2017 21:54:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 589E128553; Thu, 9 Feb 2017 21:54:32 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 0BDE42854A for ; Thu, 9 Feb 2017 21:54:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753358AbdBIVy3 (ORCPT ); Thu, 9 Feb 2017 16:54:29 -0500 Received: from quartz.orcorp.ca ([184.70.90.242]:57282 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753777AbdBIVyG (ORCPT ); Thu, 9 Feb 2017 16:54:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=obsidianresearch.com; s=rsa1; h=References:In-Reply-To:Message-Id:Date:Subject:To:From; bh=F0KdKoxP268T8k6wBCGAWiVlXqI2sQjXTI0WT1EEqug=; b=L62kWJuo3/myLkKyeNHNOpK0kqSCbBerq/T92Xf0k42JQ1265Hi7NukLF7s0FpsAiQFa5T6kZ4OzkQMw9EBAobLQZQnjzEKghcbmdbrLFCt+SYps3lgN6HPyBC/3+gb2PVyF8dBvTsC4Cgr9Y4yRYZRDBRpGY84lX8YlWTSS3bY=; Received: from [10.0.0.156] (helo=jggl.edm.orcorp.ca) by quartz.orcorp.ca with esmtps (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1cbwel-0004DE-8U for linux-rdma@vger.kernel.org; Thu, 09 Feb 2017 14:53:35 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Subject: [PATCH rdma-core 08/10] umad: Replace htonll macros with proper inlines and mark deprecated Date: Thu, 9 Feb 2017 14:53:30 -0700 Message-Id: <1486677212-3188-9-git-send-email-jgunthorpe@obsidianresearch.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1486677212-3188-1-git-send-email-jgunthorpe@obsidianresearch.com> References: <1486677212-3188-1-git-send-email-jgunthorpe@obsidianresearch.com> X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.156 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 This allowed code using these public definitions to continue to compile but will get warnings from gcc. Users should move to glibc's endian.h We want to avoid new users of these macros in our tree. Signed-off-by: Jason Gunthorpe --- libibumad/umad.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/libibumad/umad.h b/libibumad/umad.h index d574d5d32e0d20..ee8605d3418fcd 100644 --- a/libibumad/umad.h +++ b/libibumad/umad.h @@ -229,14 +229,13 @@ static inline void umad_free(void *umad) } #ifndef ntohll - #if __BYTE_ORDER == __LITTLE_ENDIAN - #define ntohll(x) bswap_64(x) - #elif __BYTE_ORDER == __BIG_ENDIAN - #define ntohll(x) x - #endif -#endif -#ifndef htonll - #define htonll ntohll +#undef htonll +#undef ntohll +/* Users should use the glibc functions directly, not these wrappers */ +static inline __attribute__((deprecated)) uint64_t htonll(uint64_t x) { return htobe64(x); } +static inline __attribute__((deprecated)) uint64_t ntohll(uint64_t x) { return be64toh(x); } +#define htonll htonll +#define ntohll ntohll #endif END_C_DECLS