From: Gerhard Sittig <gsi@denx.de>
To: linux-pci@vger.kernel.org, Jon Mason <jon.mason@intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>, Detlev Zundel <dzu@denx.de>,
Gerhard Sittig <gsi@denx.de>
Subject: [PATCH RFC v1 2/4] ntb: header file nits (multiple inclusion, explicit entries)
Date: Wed, 6 Aug 2014 16:53:53 +0200 [thread overview]
Message-ID: <1407336835-30586-3-git-send-email-gsi@denx.de> (raw)
In-Reply-To: <1407336835-30586-1-git-send-email-gsi@denx.de>
Protect NTB related header files against multiple inclusion, because
in addition to function signatures they declare data structures, too.
Add more explicit include items such that header files can be used
independently from each other, i.e. calling code does not depend on
the order of include specs to have all data types declared correctly.
Minor whitespace adjustment, to separate license texts from system
includes from local includes for easier navigation.
Signed-off-by: Gerhard Sittig <gsi@denx.de>
---
drivers/ntb/ntb_hw.h | 8 +++++++-
drivers/ntb/ntb_hw_intel.c | 1 +
drivers/ntb/ntb_transport.c | 3 +++
include/linux/ntb.h | 7 +++++++
4 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/ntb/ntb_hw.h b/drivers/ntb/ntb_hw.h
index 9cb288c045db..fe4c6306f11c 100644
--- a/drivers/ntb/ntb_hw.h
+++ b/drivers/ntb/ntb_hw.h
@@ -45,8 +45,12 @@
* Contact Information:
* Jon Mason <jon.mason@intel.com>
*/
-#include <linux/ntb.h>
+#ifndef NTB_HW_H
+#define NTB_HW_H
+#include <linux/interrupt.h>
+#include <linux/ntb.h>
+#include <linux/types.h>
#ifndef readq
static inline u64 readq(void __iomem *addr)
@@ -224,3 +228,5 @@ void *ntb_find_transport(struct pci_dev *pdev);
int ntb_transport_init(struct pci_dev *pdev);
void ntb_transport_free(void *transport);
+
+#endif /* NTB_HW_H */
diff --git a/drivers/ntb/ntb_hw_intel.c b/drivers/ntb/ntb_hw_intel.c
index 699f05132a61..a81a06c50148 100644
--- a/drivers/ntb/ntb_hw_intel.c
+++ b/drivers/ntb/ntb_hw_intel.c
@@ -53,6 +53,7 @@
#include <linux/pci.h>
#include <linux/random.h>
#include <linux/slab.h>
+
#include "ntb_hw.h"
#include "ntb_hw_intel.h"
#include "ntb_regs_intel.h"
diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
index 9dd63b822025..436326ad87bd 100644
--- a/drivers/ntb/ntb_transport.c
+++ b/drivers/ntb/ntb_transport.c
@@ -45,6 +45,7 @@
* Contact Information:
* Jon Mason <jon.mason@intel.com>
*/
+
#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/dmaengine.h>
@@ -53,9 +54,11 @@
#include <linux/export.h>
#include <linux/interrupt.h>
#include <linux/module.h>
+#include <linux/ntb.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/types.h>
+
#include "ntb_hw.h"
#define NTB_TRANSPORT_VERSION 3
diff --git a/include/linux/ntb.h b/include/linux/ntb.h
index 9ac1a62fc6f5..5b69d09db84f 100644
--- a/include/linux/ntb.h
+++ b/include/linux/ntb.h
@@ -45,6 +45,11 @@
* Contact Information:
* Jon Mason <jon.mason@intel.com>
*/
+#ifndef LINUX_NTB_H
+#define LINUX_NTB_H
+
+#include <linux/pci.h>
+#include <linux/types.h>
struct ntb_transport_qp;
@@ -86,3 +91,5 @@ void *ntb_transport_rx_remove(struct ntb_transport_qp *qp, unsigned int *len);
void ntb_transport_link_up(struct ntb_transport_qp *qp);
void ntb_transport_link_down(struct ntb_transport_qp *qp);
bool ntb_transport_link_query(struct ntb_transport_qp *qp);
+
+#endif /* LINUX_NTB_H */
--
1.7.10.4
next prev parent reply other threads:[~2014-08-06 14:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-06 14:53 [PATCH RFC v1 0/4] PCI NTB: prepare for more hardware support Gerhard Sittig
2014-08-06 14:53 ` [PATCH RFC v1 1/4] ntb: split Intel specifics out of the "NTB hardware" interface Gerhard Sittig
2014-08-06 14:53 ` Gerhard Sittig [this message]
2014-08-06 14:53 ` [PATCH RFC v1 3/4] ntb: prepare to build the 'data transport' as a separate module Gerhard Sittig
2014-08-06 14:53 ` [PATCH RFC v1 4/4] ntb: de-couple data transport from hardware support Gerhard Sittig
2014-08-06 15:01 ` [PATCH RFC v1 0/4] PCI NTB: prepare for more " Gerhard Sittig
2014-08-18 16:24 ` Gerhard Sittig
2014-08-06 20:23 ` Rajat Jain
2014-08-11 10:11 ` Gerhard Sittig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1407336835-30586-3-git-send-email-gsi@denx.de \
--to=gsi@denx.de \
--cc=bhelgaas@google.com \
--cc=dzu@denx.de \
--cc=jon.mason@intel.com \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).