From patchwork Mon May 22 14:17:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarod Wilson X-Patchwork-Id: 9740629 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 68E5D60392 for ; Mon, 22 May 2017 14:17:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5996F286BA for ; Mon, 22 May 2017 14:17:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BFB22837E; Mon, 22 May 2017 14:17:43 +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 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 F3DD92837E for ; Mon, 22 May 2017 14:17:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934644AbdEVORl (ORCPT ); Mon, 22 May 2017 10:17:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36274 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934618AbdEVORf (ORCPT ); Mon, 22 May 2017 10:17:35 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 02D54C04B941 for ; Mon, 22 May 2017 14:17:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 02D54C04B941 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jarod@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 02D54C04B941 Received: from hp-dl360pgen8-07.khw.lab.eng.bos.redhat.com (hp-dl360pgen8-07.khw.lab.eng.bos.redhat.com [10.16.184.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id A3B237FB52; Mon, 22 May 2017 14:17:25 +0000 (UTC) From: Jarod Wilson To: linux-rdma@vger.kernel.org Cc: Jarod Wilson Subject: [PATCH rdma-core] libibumad: clean up htonll/ntohnll handling Date: Mon, 22 May 2017 10:17:22 -0400 Message-Id: <20170522141722.50502-1-jarod@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 22 May 2017 14:17:30 +0000 (UTC) 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 Only ntohll was being checked to see if it wasn't defined, and was then redefining htonll as well as ntohll. This was causing some problems for the compile of the opa-ff package. Simple enough to rearrange this code a bit such that htonll and ntohll are handled entirely independent of one another. Reported-by: Honggang Li Signed-off-by: Jarod Wilson Reviewed-by: Hal Rosenstock --- libibumad/umad.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libibumad/umad.h b/libibumad/umad.h index 81811380..479165a8 100644 --- a/libibumad/umad.h +++ b/libibumad/umad.h @@ -247,15 +247,17 @@ static inline void umad_free(void *umad) free(umad); } +/* Users should use the glibc functions directly, not these wrappers */ #ifndef 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 +#ifndef htonll +#undef htonll +static inline __attribute__((deprecated)) uint64_t htonll(uint64_t x) { return htobe64(x); } +#define htonll htonll +#endif END_C_DECLS #endif /* _UMAD_H */