From patchwork Thu Sep 29 20:47:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 9357007 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 5C87160757 for ; Thu, 29 Sep 2016 20:48:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C1FE29C48 for ; Thu, 29 Sep 2016 20:48:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40AFE29C4B; Thu, 29 Sep 2016 20:48:59 +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 7313E29C48 for ; Thu, 29 Sep 2016 20:48:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933306AbcI2Us4 (ORCPT ); Thu, 29 Sep 2016 16:48:56 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:42565 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932603AbcI2Usz (ORCPT ); Thu, 29 Sep 2016 16:48:55 -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=hE0H6DtO3Gh7Ts1TbOZapXogo7DvXD34ZYSnUeVVFqA=; b=OAWYZjvaMg7bNwDGGtD/3BvKs0/lRw36ekMbf1RTk+3n09pUYgZAZkfNY8xjCUXMGAn6pzI9H9/EAhyoAMeqkvR2B8KdWEwB9tv5AQRBsoFDjPZWaVIAUYjkgxQDuMgYl9ksTB98pjL0mcxTNTrJ1JkiHBBaj2bnxgILMkGg/K0=; Received: from [10.0.0.151] (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 1bpiGA-0003uN-Ba; Thu, 29 Sep 2016 14:48:50 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Sean Hefty , Hal Rosenstock , Doug Ledford , Yishai Hadas , Vladimir Sokolovsky , Bart Van Assche Subject: [PATCH 2/9] Remove HAVE_VALGRIND_MEMCHECK_H/INCLUDE_VALGRIND Date: Thu, 29 Sep 2016 14:47:49 -0600 Message-Id: <1475182076-5411-3-git-send-email-jgunthorpe@obsidianresearch.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1475182076-5411-1-git-send-email-jgunthorpe@obsidianresearch.com> References: <1475182076-5411-1-git-send-email-jgunthorpe@obsidianresearch.com> X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.151 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 The cmake build system guarantees that valgrind/memcheck.h is present. If the system does not have it, or valgrind is disabled, then it is replaced with a dummy header full of empty stubs. Thus all the copy&paste boiler plate is consolidated into buildlib. Signed-off-by: Jason Gunthorpe Reviewed-by: Bart Van Assche Acked-by: Hal Rosenstock --- buildlib/config.h.in | 4 ---- libibcm/src/cm.c | 11 +---------- libibumad/src/umad.c | 14 +------------- libibverbs/src/ibverbs.h | 14 +------------- libmlx4/src/mlx4.h | 18 +----------------- libmlx5/src/mlx5.h | 18 +----------------- libmthca/src/mthca.h | 18 +----------------- librdmacm/src/cma.h | 11 +---------- srp_daemon/srp_daemon/srp_daemon.h | 5 ----- 9 files changed, 7 insertions(+), 106 deletions(-) diff --git a/buildlib/config.h.in b/buildlib/config.h.in index 0a87457e6d7a..a02be9cfb0f7 100644 --- a/buildlib/config.h.in +++ b/buildlib/config.h.in @@ -21,10 +21,6 @@ // FIXME: Remove this, The cmake version hard-requires new style CLOEXEC support #define STREAM_CLOEXEC "e" -// FIXME: Remove this, cmake always provides a valgrind/memcheck.h -#define HAVE_VALGRIND_MEMCHECK_H 1 -#define INCLUDE_VALGRIND 1 - #define IBV_CONFIG_DIR "@CONFIG_DIR@" #define RS_CONF_DIR "@CMAKE_INSTALL_FULL_SYSCONFDIR@/rdma/rsocket" #define IWPM_CONFIG_FILE "@CMAKE_INSTALL_FULL_SYSCONFDIR@/iwpmd.conf" diff --git a/libibcm/src/cm.c b/libibcm/src/cm.c index ebe36bef89e6..f775923aa73c 100644 --- a/libibcm/src/cm.c +++ b/libibcm/src/cm.c @@ -49,16 +49,7 @@ #include #include -#ifdef INCLUDE_VALGRIND -# include -# ifndef VALGRIND_MAKE_MEM_DEFINED -# warning "Valgrind requested, but VALGRIND_MAKE_MEM_DEFINED undefined" -# endif -#endif - -#ifndef VALGRIND_MAKE_MEM_DEFINED -# define VALGRIND_MAKE_MEM_DEFINED(addr,len) -#endif +#include #define PFX "libibcm: " diff --git a/libibumad/src/umad.c b/libibumad/src/umad.c index 176d112e125b..0c969f1eb8ad 100644 --- a/libibumad/src/umad.c +++ b/libibumad/src/umad.c @@ -52,19 +52,7 @@ #define IB_OPENIB_OUI (0x001405) -#ifdef HAVE_VALGRIND_MEMCHECK_H - -# include - -# ifndef VALGRIND_MAKE_MEM_DEFINED -# warning "Valgrind support requested, but VALGRIND_MAKE_MEM_DEFINED not available" -# endif - -#endif /* HAVE_VALGRIND_MEMCHECK_H */ - -#ifndef VALGRIND_MAKE_MEM_DEFINED -# define VALGRIND_MAKE_MEM_DEFINED(addr,len) -#endif +#include typedef struct ib_user_mad_reg_req { uint32_t id; diff --git a/libibverbs/src/ibverbs.h b/libibverbs/src/ibverbs.h index 062a490915b0..7892af4ad247 100644 --- a/libibverbs/src/ibverbs.h +++ b/libibverbs/src/ibverbs.h @@ -38,19 +38,7 @@ #include -#ifdef HAVE_VALGRIND_MEMCHECK_H - -# include - -# ifndef VALGRIND_MAKE_MEM_DEFINED -# warning "Valgrind support requested, but VALGRIND_MAKE_MEM_DEFINED not available" -# endif - -#endif /* HAVE_VALGRIND_MEMCHECK_H */ - -#ifndef VALGRIND_MAKE_MEM_DEFINED -# define VALGRIND_MAKE_MEM_DEFINED(addr, len) 0 -#endif +#include #define HIDDEN __attribute__((visibility ("hidden"))) diff --git a/libmlx4/src/mlx4.h b/libmlx4/src/mlx4.h index feea3386f9a7..4551141d2007 100644 --- a/libmlx4/src/mlx4.h +++ b/libmlx4/src/mlx4.h @@ -47,23 +47,7 @@ #define uninitialized_var(x) x = x #endif -#ifdef HAVE_VALGRIND_MEMCHECK_H - -# include - -# if !defined(VALGRIND_MAKE_MEM_DEFINED) || !defined(VALGRIND_MAKE_MEM_UNDEFINED) -# warning "Valgrind support requested, but VALGRIND_MAKE_MEM_(UN)DEFINED not available" -# endif - -#endif /* HAVE_VALGRIND_MEMCHECK_H */ - -#ifndef VALGRIND_MAKE_MEM_DEFINED -# define VALGRIND_MAKE_MEM_DEFINED(addr,len) -#endif - -#ifndef VALGRIND_MAKE_MEM_UNDEFINED -# define VALGRIND_MAKE_MEM_UNDEFINED(addr,len) -#endif +#include #ifndef rmb # define rmb() mb() diff --git a/libmlx5/src/mlx5.h b/libmlx5/src/mlx5.h index 6c4e83002028..aa8b6feceb4e 100644 --- a/libmlx5/src/mlx5.h +++ b/libmlx5/src/mlx5.h @@ -52,23 +52,7 @@ #define uninitialized_var(x) x = x #endif -#ifdef HAVE_VALGRIND_MEMCHECK_H - -# include - -# if !defined(VALGRIND_MAKE_MEM_DEFINED) || !defined(VALGRIND_MAKE_MEM_UNDEFINED) -# warning "Valgrind support requested, but VALGRIND_MAKE_MEM_(UN)DEFINED not available" -# endif - -#endif /* HAVE_VALGRIND_MEMCHECK_H */ - -#ifndef VALGRIND_MAKE_MEM_DEFINED -# define VALGRIND_MAKE_MEM_DEFINED(addr, len) -#endif - -#ifndef VALGRIND_MAKE_MEM_UNDEFINED -# define VALGRIND_MAKE_MEM_UNDEFINED(addr, len) -#endif +#include #ifndef rmb # define rmb() mb() diff --git a/libmthca/src/mthca.h b/libmthca/src/mthca.h index bd1e7a2b1dc0..18d52291343f 100644 --- a/libmthca/src/mthca.h +++ b/libmthca/src/mthca.h @@ -39,23 +39,7 @@ #include #include -#ifdef HAVE_VALGRIND_MEMCHECK_H - -# include - -# if !defined(VALGRIND_MAKE_MEM_DEFINED) || !defined(VALGRIND_MAKE_MEM_UNDEFINED) -# warning "Valgrind support requested, but VALGRIND_MAKE_MEM_(UN)DEFINED not available" -# endif - -#endif /* HAVE_VALGRIND_MEMCHECK_H */ - -#ifndef VALGRIND_MAKE_MEM_DEFINED -# define VALGRIND_MAKE_MEM_DEFINED(addr,len) -#endif - -#ifndef VALGRIND_MAKE_MEM_UNDEFINED -# define VALGRIND_MAKE_MEM_UNDEFINED(addr,len) -#endif +#include #ifndef rmb # define rmb() mb() diff --git a/librdmacm/src/cma.h b/librdmacm/src/cma.h index d6005538227f..16a55a67af9e 100644 --- a/librdmacm/src/cma.h +++ b/librdmacm/src/cma.h @@ -47,16 +47,7 @@ #include -#ifdef INCLUDE_VALGRIND -# include -# ifndef VALGRIND_MAKE_MEM_DEFINED -# warning "Valgrind requested, but VALGRIND_MAKE_MEM_DEFINED undefined" -# endif -#endif - -#ifndef VALGRIND_MAKE_MEM_DEFINED -# define VALGRIND_MAKE_MEM_DEFINED(addr,len) -#endif +#include #define PFX "librdmacm: " diff --git a/srp_daemon/srp_daemon/srp_daemon.h b/srp_daemon/srp_daemon/srp_daemon.h index 6d1575519bc3..d6a2d8a84728 100644 --- a/srp_daemon/srp_daemon/srp_daemon.h +++ b/srp_daemon/srp_daemon/srp_daemon.h @@ -408,12 +408,7 @@ typedef struct { char filler[MAD_BLOCK_SIZE]; } srp_ib_user_mad_t; -#if defined(HAVE_VALGRIND_DRD_H) && defined(ENABLE_VALGRIND) #include -#endif -#ifndef ANNOTATE_BENIGN_RACE_SIZED -#define ANNOTATE_BENIGN_RACE_SIZED(a, b, c) do { } while(0) -#endif #define pr_human(arg...) \ do { \