From patchwork Thu Oct 13 17:51:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9375611 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 0C67D607FD for ; Thu, 13 Oct 2016 18:22:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00B172A16D for ; Thu, 13 Oct 2016 18:22:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5D412A176; Thu, 13 Oct 2016 18:22: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.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 735E02A16D for ; Thu, 13 Oct 2016 18:22:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933944AbcJMSWg (ORCPT ); Thu, 13 Oct 2016 14:22:36 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:55816 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933943AbcJMSWf (ORCPT ); Thu, 13 Oct 2016 14:22:35 -0400 Received: from [83.175.99.196] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.85_2 #1 (Red Hat Linux)) id 1bukAT-0001xi-1T for linux-rdma@vger.kernel.org; Thu, 13 Oct 2016 17:51:45 +0000 From: Christoph Hellwig To: linux-rdma@vger.kernel.org Subject: [PATCH 02/32] libibumad: create sysfs.h instead of using extern declarations in umad.c Date: Thu, 13 Oct 2016 19:51:05 +0200 Message-Id: <1476381095-20041-3-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1476381095-20041-1-git-send-email-hch@lst.de> References: <1476381095-20041-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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 So that we have the prototypes available in the implementation file and do get proper type checking for them. Signed-off-by: Christoph Hellwig Reviewed-by: Hal Rosenstock --- libibumad/sysfs.c | 1 + libibumad/sysfs.h | 10 ++++++++++ libibumad/umad.c | 7 +------ 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 libibumad/sysfs.h diff --git a/libibumad/sysfs.c b/libibumad/sysfs.c index 011e411..83f89b4 100644 --- a/libibumad/sysfs.c +++ b/libibumad/sysfs.c @@ -44,6 +44,7 @@ #include #include #include +#include "sysfs.h" static int ret_code(void) { diff --git a/libibumad/sysfs.h b/libibumad/sysfs.h new file mode 100644 index 0000000..7f8cbfe --- /dev/null +++ b/libibumad/sysfs.h @@ -0,0 +1,10 @@ +#ifndef _UMAD_SYSFS_H +#define _UMAD_SYSFS_H + +extern int sys_read_string(const char *dir_name, const char *file_name, char *str, int len); +extern int sys_read_guid(const char *dir_name, const char *file_name, uint64_t * net_guid); +extern int sys_read_gid(const char *dir_name, const char *file_name, uint8_t * gid); +extern int sys_read_uint64(const char *dir_name, const char *file_name, uint64_t * u); +extern int sys_read_uint(const char *dir_name, const char *file_name, unsigned *u); + +#endif /* _UMAD_SYSFS_H */ diff --git a/libibumad/umad.c b/libibumad/umad.c index 0c969f1..8860b99 100644 --- a/libibumad/umad.c +++ b/libibumad/umad.c @@ -53,6 +53,7 @@ #define IB_OPENIB_OUI (0x001405) #include +#include "sysfs.h" typedef struct ib_user_mad_reg_req { uint32_t id; @@ -77,12 +78,6 @@ struct ib_user_mad_reg_req2 { uint8_t reserved[3]; }; -extern int sys_read_string(const char *dir_name, const char *file_name, char *str, int len); -extern int sys_read_guid(const char *dir_name, const char *file_name, uint64_t * net_guid); -extern int sys_read_gid(const char *dir_name, const char *file_name, uint8_t * gid); -extern int sys_read_uint64(const char *dir_name, const char *file_name, uint64_t * u); -extern int sys_read_uint(const char *dir_name, const char *file_name, unsigned *u); - #define IBWARN(fmt, args...) fprintf(stderr, "ibwarn: [%d] %s: " fmt "\n", getpid(), __func__, ## args) #define TRACE if (umaddebug) IBWARN