[OpenBIOS] [commit] r785 - trunk/openbios-devel/drivers

repository service svn at openbios.org
Thu May 27 22:12:07 CEST 2010


Author: blueswirl
Date: Thu May 27 22:12:05 2010
New Revision: 785
URL: http://tracker.coreboot.org/trac/openbios/changeset/785

Log:
pci: debug printk macros

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko at gmail.com>
Signed-off-by: Blue Swirl <blauwirbel at gmail.com>

Modified:
   trunk/openbios-devel/drivers/pci.c

Modified: trunk/openbios-devel/drivers/pci.c
==============================================================================
--- trunk/openbios-devel/drivers/pci.c	Thu May 27 22:12:02 2010	(r784)
+++ trunk/openbios-devel/drivers/pci.c	Thu May 27 22:12:05 2010	(r785)
@@ -32,6 +32,12 @@
 #include "macio.h"
 #endif
 
+#if defined (CONFIG_DEBUG_PCI)
+# define PCI_DPRINTF(format, ...) printk(format, ## __VA_ARGS__)
+#else
+# define PCI_DPRINTF(format, ...) do { } while (0)
+#endif
+
 #define set_bool_property(ph, name) set_property(ph, name, NULL, 0);
 
 /* DECLARE data structures for the nodes.  */
@@ -824,9 +830,7 @@
 	pci_set_assigned_addresses(config, num_bars);
 	OLDWORLD(pci_set_AAPL_address(config));
 
-#ifdef CONFIG_DEBUG_PCI
-	printk("\n");
-#endif
+	PCI_DPRINTF("\n");
 
 	if (pci_dev && pci_dev->config_cb)
 		pci_dev->config_cb(config);
@@ -1010,10 +1014,9 @@
 			pci_dev = pci_find_device(class, subclass, iface,
 						  vid, did);
 
-#ifdef CONFIG_DEBUG_PCI
-			printk("%x:%x.%x - %x:%x - ", bus, devnum, fn,
+			PCI_DPRINTF("%x:%x.%x - %x:%x - ", bus, devnum, fn,
 					vid, did);
-#endif
+
 			htype = pci_config_read8(addr, PCI_HEADER_TYPE);
 			if (fn == 0)
 				is_multi = htype & 0x80;
@@ -1024,9 +1027,9 @@
 			else
                             snprintf(config.path, sizeof(config.path),
 				     "%s/%s", *path, pci_dev->name);
-#ifdef CONFIG_DEBUG_PCI
-			printk("%s - ", config.path);
-#endif
+
+			PCI_DPRINTF("%s - ", config.path);
+
 			config.dev = addr & 0x00FFFFFF;
 
                         if (class == PCI_BASE_CLASS_BRIDGE &&
@@ -1069,9 +1072,7 @@
         unsigned long mem_base, io_base;
 	char *path;
 
-#ifdef CONFIG_DEBUG_PCI
-	printk("Initializing PCI devices...\n");
-#endif
+	PCI_DPRINTF("Initializing PCI devices...\n");
 
 	/* brute force bus scan */
 



More information about the OpenBIOS mailing list