aboutsummaryrefslogtreecommitdiff
path: root/hw/phb3.c
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2014-07-31 14:29:51 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-08-08 16:07:26 +1000
commit6150a663a5e6d26ec89413186cd7468d621e0bc5 (patch)
tree641f1552888aabb05e8db09b4fd06c785128f26b /hw/phb3.c
parent09e08414c6ac42837428f4b046afcec82cf5a197 (diff)
downloadskiboot-6150a663a5e6d26ec89413186cd7468d621e0bc5.zip
skiboot-6150a663a5e6d26ec89413186cd7468d621e0bc5.tar.gz
skiboot-6150a663a5e6d26ec89413186cd7468d621e0bc5.tar.bz2
Use small macros for PHB debug/log messages
Save stack space, remove code and improve logging all in one handy patch. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'hw/phb3.c')
-rw-r--r--hw/phb3.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/hw/phb3.c b/hw/phb3.c
index 90e5be5..5fea035 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -51,26 +51,12 @@
static void phb3_init_hw(struct phb3 *p);
-static void phb3_trace(struct phb3 *p, FILE *s, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
-
-static void phb3_trace(struct phb3 *p, FILE *s, const char *fmt, ...)
-{
- /* Use a temp stack buffer to print all at once to avoid
- * mixups of a trace entry on SMP
- */
- char tbuf[128 + 10];
- va_list args;
- char *b = tbuf;
-
- b += sprintf(b, "PHB%d: ", p->phb.opal_id);
- va_start(args, fmt);
- vsnprintf(b, 128, fmt, args);
- va_end(args);
- fputs(tbuf, s);
-}
-#define PHBDBG(p, fmt...) phb3_trace(p, stdout, fmt)
-#define PHBINF(p, fmt...) phb3_trace(p, stderr, fmt)
-#define PHBERR(p, fmt...) phb3_trace(p, stderr, fmt)
+#define PHBDBG(p, fmt, a...) prlog(PR_DEBUG, "PHB%d: " fmt, \
+ (p)->phb.opal_id, ## a)
+#define PHBINF(p, fmt, a...) prlog(PR_INFO, "PHB%d: " fmt, \
+ (p)->phb.opal_id, ## a)
+#define PHBERR(p, fmt, a...) prlog(PR_ERR, "PHB%d: " fmt, \
+ (p)->phb.opal_id, ## a)
/*
* Lock callbacks. Allows the OPAL API handlers to lock the