aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorGavin Shan <shangw@linux.vnet.ibm.com>2012-10-17 15:53:30 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-11-14 21:00:08 -0500
commit490e078d6a21aa90d54f36cdcc544e87070175bd (patch)
tree5fd8dbdc77ee9504b1b32db19c044db75c7f24dc /arch/powerpc
parent40c935ae3de413d6bbc5471c231c90e26a63d562 (diff)
powerpc/pnv: Avoid bogus output
There're couples of functions defined to print debugging messages during initializing P7IOC. However, we got bogus output from those functions like pe_info(). The problem here is that the message level (the first parameter to printk()) isn't printable and that caused the bogus output. The patch fixes the issue by merging __pe_printk() to the macro define_pe_printk_level() so that we can pass the message level directly to printk(). Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 471aa3ccd9fd..53d052e95cfc 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -34,24 +34,12 @@
34#include "powernv.h" 34#include "powernv.h"
35#include "pci.h" 35#include "pci.h"
36 36
37static int __pe_printk(const char *level, const struct pnv_ioda_pe *pe,
38 struct va_format *vaf)
39{
40 char pfix[32];
41
42 if (pe->pdev)
43 strlcpy(pfix, dev_name(&pe->pdev->dev), sizeof(pfix));
44 else
45 sprintf(pfix, "%04x:%02x ",
46 pci_domain_nr(pe->pbus), pe->pbus->number);
47 return printk("pci %s%s: [PE# %.3d] %pV", level, pfix, pe->pe_number, vaf);
48}
49
50#define define_pe_printk_level(func, kern_level) \ 37#define define_pe_printk_level(func, kern_level) \
51static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \ 38static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \
52{ \ 39{ \
53 struct va_format vaf; \ 40 struct va_format vaf; \
54 va_list args; \ 41 va_list args; \
42 char pfix[32]; \
55 int r; \ 43 int r; \
56 \ 44 \
57 va_start(args, fmt); \ 45 va_start(args, fmt); \
@@ -59,7 +47,16 @@ static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \
59 vaf.fmt = fmt; \ 47 vaf.fmt = fmt; \
60 vaf.va = &args; \ 48 vaf.va = &args; \
61 \ 49 \
62 r = __pe_printk(kern_level, pe, &vaf); \ 50 if (pe->pdev) \
51 strlcpy(pfix, dev_name(&pe->pdev->dev), \
52 sizeof(pfix)); \
53 else \
54 sprintf(pfix, "%04x:%02x ", \
55 pci_domain_nr(pe->pbus), \
56 pe->pbus->number); \
57 r = printk(kern_level "pci %s: [PE# %.3d] %pV", \
58 pfix, pe->pe_number, &vaf); \
59 \
63 va_end(args); \ 60 va_end(args); \
64 \ 61 \
65 return r; \ 62 return r; \