diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2014-07-31 14:29:51 +1000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-08-08 16:07:26 +1000 |
commit | 6150a663a5e6d26ec89413186cd7468d621e0bc5 (patch) | |
tree | 641f1552888aabb05e8db09b4fd06c785128f26b /hw/p7ioc-phb.c | |
parent | 09e08414c6ac42837428f4b046afcec82cf5a197 (diff) | |
download | skiboot-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/p7ioc-phb.c')
-rw-r--r-- | hw/p7ioc-phb.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/hw/p7ioc-phb.c b/hw/p7ioc-phb.c index 834a794..fd2ebd6 100644 --- a/hw/p7ioc-phb.c +++ b/hw/p7ioc-phb.c @@ -26,26 +26,10 @@ #include <opal.h> #include <ccan/str/str.h> -static void p7ioc_phb_trace(struct p7ioc_phb *p, FILE *s, const char *fmt, ...) -__attribute__ ((format (printf, 3, 4))); - -static void p7ioc_phb_trace(struct p7ioc_phb *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...) p7ioc_phb_trace(p, stdout, fmt) -#define PHBERR(p, fmt...) p7ioc_phb_trace(p, stderr, fmt) +#define PHBDBG(p, fmt, a...) prlog(PR_DEBUG, "PHB%d: " fmt, \ + (p)->phb.opal_id, ## a) +#define PHBERR(p, fmt, a...) prlog(PR_ERR, "PHB%d: " fmt, \ + (p)->phb.opal_id, ## a) /* Helper to select an IODA table entry */ static inline void p7ioc_phb_ioda_sel(struct p7ioc_phb *p, uint32_t table, |