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/phb3.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/phb3.c')
-rw-r--r-- | hw/phb3.c | 26 |
1 files changed, 6 insertions, 20 deletions
@@ -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 |