diff mbox series

[1/6] pci: Move logging macros to pci.h

Message ID 1533153679-10109-2-git-send-email-arbab@linux.ibm.com
State Accepted
Headers show
Series npu2: Add support for relaxed-ordering mode | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied

Commit Message

Reza Arbab Aug. 1, 2018, 8:01 p.m. UTC
Move the PCI{TRACE,DBG,NOTICE,ERR} logging macros from pci.c to pci.h so
they can be used in other files.

Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
Reviewed-by: Alistair Popple <alistair@popple.id.au>
---
 core/pci.c    | 21 ---------------------
 include/pci.h | 21 +++++++++++++++++++++
 2 files changed, 21 insertions(+), 21 deletions(-)
diff mbox series

Patch

diff --git a/core/pci.c b/core/pci.c
index 109459b..6ba6eda 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -29,27 +29,6 @@ 
 static struct phb *phbs[MAX_PHB_ID];
 int last_phb_id = 0;
 
-#define PCITRACE(_p, _bdfn, fmt, a...) \
-	prlog(PR_TRACE, "PHB#%04x:%02x:%02x.%x " fmt,	\
-	      (_p)->opal_id,				\
-	      ((_bdfn) >> 8) & 0xff,			\
-	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
-#define PCIDBG(_p, _bdfn, fmt, a...) \
-	prlog(PR_DEBUG, "PHB#%04x:%02x:%02x.%x " fmt,	\
-	      (_p)->opal_id,				\
-	      ((_bdfn) >> 8) & 0xff,			\
-	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
-#define PCINOTICE(_p, _bdfn, fmt, a...) \
-	prlog(PR_NOTICE, "PHB#%04x:%02x:%02x.%x " fmt,	\
-	      (_p)->opal_id,				\
-	      ((_bdfn) >> 8) & 0xff,			\
-	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
-#define PCIERR(_p, _bdfn, fmt, a...) \
-	prlog(PR_ERR, "PHB#%04x:%02x:%02x.%x " fmt,	\
-	      (_p)->opal_id,				\
-	      ((_bdfn) >> 8) & 0xff,			\
-	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
-
 /*
  * Generic PCI utilities
  */
diff --git a/include/pci.h b/include/pci.h
index 253dbd8..c6aa664 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -23,6 +23,27 @@ 
 #include <bitmap.h>
 #include <ccan/list/list.h>
 
+#define PCITRACE(_p, _bdfn, fmt, a...) \
+	prlog(PR_TRACE, "PHB#%04x:%02x:%02x.%x " fmt,	\
+	      (_p)->opal_id,				\
+	      ((_bdfn) >> 8) & 0xff,			\
+	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
+#define PCIDBG(_p, _bdfn, fmt, a...) \
+	prlog(PR_DEBUG, "PHB#%04x:%02x:%02x.%x " fmt,	\
+	      (_p)->opal_id,				\
+	      ((_bdfn) >> 8) & 0xff,			\
+	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
+#define PCINOTICE(_p, _bdfn, fmt, a...) \
+	prlog(PR_NOTICE, "PHB#%04x:%02x:%02x.%x " fmt,	\
+	      (_p)->opal_id,				\
+	      ((_bdfn) >> 8) & 0xff,			\
+	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
+#define PCIERR(_p, _bdfn, fmt, a...) \
+	prlog(PR_ERR, "PHB#%04x:%02x:%02x.%x " fmt,	\
+	      (_p)->opal_id,				\
+	      ((_bdfn) >> 8) & 0xff,			\
+	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
+
 struct pci_device;
 struct pci_cfg_reg_filter;