[Skiboot] [PATCH] hw/bt: improve logging

Cédric Le Goater clg at fr.ibm.com
Wed Jan 6 20:33:59 AEDT 2016


This patch adds a "BT: " prefix to all logs and replaces a forgotten
printf.

Signed-off-by: Cédric Le Goater <clg at fr.ibm.com>
---
 hw/bt.c |   23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

Index: skiboot.git/hw/bt.c
===================================================================
--- skiboot.git.orig/hw/bt.c
+++ skiboot.git/hw/bt.c
@@ -77,15 +77,16 @@
 
 #define _BT_Q_LOG(level, msg, fmt, args...) \
 	do { if (msg) \
-			prlog(level, "BT seq 0x%02x netfn 0x%02x cmd 0x%02x: " fmt "\n", \
+			prlog(level, "BT: seq 0x%02x netfn 0x%02x cmd 0x%02x: " fmt "\n", \
 			(msg)->seq, (msg)->ipmi_msg.netfn, (msg)->ipmi_msg.cmd, ##args); \
 		else \
-			prlog(level, "BT seq 0x?? netfn 0x?? cmd 0x??: " fmt "\n", ##args); \
+			prlog(level, "BT: seq 0x?? netfn 0x?? cmd 0x??: " fmt "\n", ##args); \
 	} while(0)
 
-#define BT_ERR(fmt, args...) prlog(PR_ERR, fmt, ##args)
-#define BT_DBG(fmt, args...) prlog(PR_DEBUG, fmt, ##args)
-#define BT_INF(fmt, args...) prlog(PR_INFO, fmt, ##args)
+#define BT_ERR(fmt, args...) prlog(PR_ERR, "BT: " fmt, ##args)
+#define BT_DBG(fmt, args...) prlog(PR_DEBUG, "BT: " fmt, ##args)
+#define BT_INF(fmt, args...) prlog(PR_INFO, "BT: " fmt, ##args)
+#define BT_NOTICE(fmt, args...) prlog(PR_NOTICE, "BT: " fmt, ##args)
 
 /*
  * takes a struct bt_msg *
@@ -344,8 +345,8 @@ static void bt_get_resp(void)
 	}
 	if (!bt_msg) {
 		/* A response to a message we no longer care about. */
-		BT_INF("BT: Nobody cared about a response to an BT/IPMI message"
-			"(seq 0x%02x netfn 0x%02x cmd 0x%02x)", seq, netfn, cmd);
+		BT_INF("Nobody cared about a response to an BT/IPMI message"
+		       "(seq 0x%02x netfn 0x%02x cmd 0x%02x)\n", seq, netfn, cmd);
 		bt_flush_msg();
 		return;
 	}
@@ -638,11 +639,11 @@ void bt_init(void)
 	/* Get IO base */
 	prop = dt_find_property(n, "reg");
 	if (!prop) {
-		BT_ERR("BT: Can't find reg property\n");
+		BT_ERR("Can't find reg property\n");
 		return;
 	}
 	if (dt_property_get_cell(prop, 0) != OPAL_LPC_IO) {
-		BT_ERR("BT: Only supports IO addresses\n");
+		BT_ERR("Only supports IO addresses\n");
 		return;
 	}
 	bt.base_addr = dt_property_get_cell(prop, 1);
@@ -658,7 +659,7 @@ void bt_init(void)
 	list_head_init(&bt.msgq);
 	bt.queue_len = 0;
 
-	printf("BT: Interface initialized, IO 0x%04x\n", bt.base_addr);
+	BT_NOTICE("Interface initialized, IO 0x%04x\n", bt.base_addr);
 
 	ipmi_register_backend(&bt_backend);
 
@@ -675,5 +676,5 @@ void bt_init(void)
 	/* Enqueue an IPMI message to ask the BMC about its BT capabilities */
 	get_bt_caps();
 
-	BT_DBG("BT: Using LPC IRQ %d\n", irq);
+	BT_DBG("Using LPC IRQ %d\n", irq);
 }



More information about the Skiboot mailing list