From patchwork Thu Apr 6 22:42:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 9668521 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 1CA0E602B3 for ; Thu, 6 Apr 2017 22:42:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07CE0285EB for ; Thu, 6 Apr 2017 22:42:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F08CC285ED; Thu, 6 Apr 2017 22:42:37 +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 9446B285DC for ; Thu, 6 Apr 2017 22:42:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754747AbdDFWme (ORCPT ); Thu, 6 Apr 2017 18:42:34 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:43151 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754313AbdDFWmb (ORCPT ); Thu, 6 Apr 2017 18:42:31 -0400 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:Cc:To:From; bh=fdIN9XBTzBpqJlXzbuEe6BnY9DXU+NppRjKymKdcf6M=; b=YXGNR8ZiunQLcQ7y1Y3mhGJTJzpqjEXZs/HvahXXHhG1yBnVs6goYcyOGh+DMbpnF6yxaU9hbKRxSTdlynaHv3Io4sxoqkK8mxYb4/L9zv6K8S6/Bho0ypXaxEn3oXJAzRK0ts70Ykn1D3ICQXCuIzs1wYPOZgXDqY6uinFvno0=; 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 1cwG6n-0006qQ-LF; Thu, 06 Apr 2017 16:42:29 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Moni Shoua Subject: [PATCH rdma-core 1/6] rxe: Use libc's IN6_IS_ADDR_V4MAPPED Date: Thu, 6 Apr 2017 16:42:20 -0600 Message-Id: <1491518545-14746-2-git-send-email-jgunthorpe@obsidianresearch.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491518545-14746-1-git-send-email-jgunthorpe@obsidianresearch.com> References: <1491518545-14746-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 Instead of the open coded version, makes sparse work. Signed-off-by: Jason Gunthorpe --- CMakeLists.txt | 4 ++-- providers/rxe/rxe.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a05c3602bca2d..e5074f6e100637 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -392,8 +392,8 @@ endif() add_subdirectory(providers/hfi1verbs) # NO SPARSE add_subdirectory(providers/ipathverbs) # NO SPARSE -add_subdirectory(providers/rxe) # NO SPARSE -add_subdirectory(providers/rxe/man) # NO SPARSE +add_subdirectory(providers/rxe) +add_subdirectory(providers/rxe/man) # Binaries add_subdirectory(ibacm) # NO SPARSE diff --git a/providers/rxe/rxe.c b/providers/rxe/rxe.c index 438f7c30505dd1..775caf0e185148 100644 --- a/providers/rxe/rxe.c +++ b/providers/rxe/rxe.c @@ -753,8 +753,7 @@ static int rxe_post_recv(struct ibv_qp *ibqp, static inline int ipv6_addr_v4mapped(const struct in6_addr *a) { - return ((unsigned long)(a->s6_addr32[0] | a->s6_addr32[1]) | - (unsigned long)(a->s6_addr32[2] ^ htobe32(0x0000ffff))) == 0UL; + return IN6_IS_ADDR_V4MAPPED(a); } static inline int rdma_gid2ip(struct sockaddr *out, union ibv_gid *gid)