diff options
author | Hanjun Guo <hanjun.guo@linaro.org> | 2014-02-20 02:45:33 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-03-01 19:34:16 -0500 |
commit | 730bf5ebb4dfb3ec654bb6c270aa55de70ebf54d (patch) | |
tree | 545e25c35e340230066348669fdcabf1f7ba104d | |
parent | cfbf8d4857c26a8a307fb7cd258074c9dcd8c691 (diff) |
ACPI / tables: Replace printk with pr_*
This patch just does some cleanup to replace printk with pr_*,
and introduces pr_fmt() to remove all PREFIXs in tables.c,
no functional change.
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/acpi/tables.c | 128 |
1 files changed, 55 insertions, 73 deletions
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 5837f857ac2e..21782290df41 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c | |||
@@ -23,6 +23,8 @@ | |||
23 | * | 23 | * |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #define pr_fmt(fmt) "ACPI: " fmt | ||
27 | |||
26 | #include <linux/init.h> | 28 | #include <linux/init.h> |
27 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
28 | #include <linux/smp.h> | 30 | #include <linux/smp.h> |
@@ -33,8 +35,6 @@ | |||
33 | #include <linux/acpi.h> | 35 | #include <linux/acpi.h> |
34 | #include <linux/bootmem.h> | 36 | #include <linux/bootmem.h> |
35 | 37 | ||
36 | #define PREFIX "ACPI: " | ||
37 | |||
38 | #define ACPI_MAX_TABLES 128 | 38 | #define ACPI_MAX_TABLES 128 |
39 | 39 | ||
40 | static char *mps_inti_flags_polarity[] = { "dfl", "high", "res", "low" }; | 40 | static char *mps_inti_flags_polarity[] = { "dfl", "high", "res", "low" }; |
@@ -55,10 +55,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) | |||
55 | { | 55 | { |
56 | struct acpi_madt_local_apic *p = | 56 | struct acpi_madt_local_apic *p = |
57 | (struct acpi_madt_local_apic *)header; | 57 | (struct acpi_madt_local_apic *)header; |
58 | printk(KERN_INFO PREFIX | 58 | pr_info("LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", |
59 | "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", | 59 | p->processor_id, p->id, |
60 | p->processor_id, p->id, | 60 | (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); |
61 | (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); | ||
62 | } | 61 | } |
63 | break; | 62 | break; |
64 | 63 | ||
@@ -66,11 +65,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) | |||
66 | { | 65 | { |
67 | struct acpi_madt_local_x2apic *p = | 66 | struct acpi_madt_local_x2apic *p = |
68 | (struct acpi_madt_local_x2apic *)header; | 67 | (struct acpi_madt_local_x2apic *)header; |
69 | printk(KERN_INFO PREFIX | 68 | pr_info("X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n", |
70 | "X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n", | 69 | p->local_apic_id, p->uid, |
71 | p->local_apic_id, p->uid, | 70 | (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); |
72 | (p->lapic_flags & ACPI_MADT_ENABLED) ? | ||
73 | "enabled" : "disabled"); | ||
74 | } | 71 | } |
75 | break; | 72 | break; |
76 | 73 | ||
@@ -78,9 +75,8 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) | |||
78 | { | 75 | { |
79 | struct acpi_madt_io_apic *p = | 76 | struct acpi_madt_io_apic *p = |
80 | (struct acpi_madt_io_apic *)header; | 77 | (struct acpi_madt_io_apic *)header; |
81 | printk(KERN_INFO PREFIX | 78 | pr_info("IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n", |
82 | "IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n", | 79 | p->id, p->address, p->global_irq_base); |
83 | p->id, p->address, p->global_irq_base); | ||
84 | } | 80 | } |
85 | break; | 81 | break; |
86 | 82 | ||
@@ -88,18 +84,15 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) | |||
88 | { | 84 | { |
89 | struct acpi_madt_interrupt_override *p = | 85 | struct acpi_madt_interrupt_override *p = |
90 | (struct acpi_madt_interrupt_override *)header; | 86 | (struct acpi_madt_interrupt_override *)header; |
91 | printk(KERN_INFO PREFIX | 87 | pr_info("INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n", |
92 | "INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n", | 88 | p->bus, p->source_irq, p->global_irq, |
93 | p->bus, p->source_irq, p->global_irq, | 89 | mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], |
94 | mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], | 90 | mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2]); |
95 | mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2]); | ||
96 | if (p->inti_flags & | 91 | if (p->inti_flags & |
97 | ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK)) | 92 | ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK)) |
98 | printk(KERN_INFO PREFIX | 93 | pr_info("INT_SRC_OVR unexpected reserved flags: 0x%x\n", |
99 | "INT_SRC_OVR unexpected reserved flags: 0x%x\n", | 94 | p->inti_flags & |
100 | p->inti_flags & | ||
101 | ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK)); | 95 | ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK)); |
102 | |||
103 | } | 96 | } |
104 | break; | 97 | break; |
105 | 98 | ||
@@ -107,11 +100,10 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) | |||
107 | { | 100 | { |
108 | struct acpi_madt_nmi_source *p = | 101 | struct acpi_madt_nmi_source *p = |
109 | (struct acpi_madt_nmi_source *)header; | 102 | (struct acpi_madt_nmi_source *)header; |
110 | printk(KERN_INFO PREFIX | 103 | pr_info("NMI_SRC (%s %s global_irq %d)\n", |
111 | "NMI_SRC (%s %s global_irq %d)\n", | 104 | mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], |
112 | mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], | 105 | mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], |
113 | mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], | 106 | p->global_irq); |
114 | p->global_irq); | ||
115 | } | 107 | } |
116 | break; | 108 | break; |
117 | 109 | ||
@@ -119,12 +111,11 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) | |||
119 | { | 111 | { |
120 | struct acpi_madt_local_apic_nmi *p = | 112 | struct acpi_madt_local_apic_nmi *p = |
121 | (struct acpi_madt_local_apic_nmi *)header; | 113 | (struct acpi_madt_local_apic_nmi *)header; |
122 | printk(KERN_INFO PREFIX | 114 | pr_info("LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n", |
123 | "LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n", | 115 | p->processor_id, |
124 | p->processor_id, | 116 | mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK ], |
125 | mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK ], | 117 | mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], |
126 | mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], | 118 | p->lint); |
127 | p->lint); | ||
128 | } | 119 | } |
129 | break; | 120 | break; |
130 | 121 | ||
@@ -137,12 +128,11 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) | |||
137 | polarity = p->inti_flags & ACPI_MADT_POLARITY_MASK; | 128 | polarity = p->inti_flags & ACPI_MADT_POLARITY_MASK; |
138 | trigger = (p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2; | 129 | trigger = (p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2; |
139 | 130 | ||
140 | printk(KERN_INFO PREFIX | 131 | pr_info("X2APIC_NMI (uid[0x%02x] %s %s lint[0x%x])\n", |
141 | "X2APIC_NMI (uid[0x%02x] %s %s lint[0x%x])\n", | 132 | p->uid, |
142 | p->uid, | 133 | mps_inti_flags_polarity[polarity], |
143 | mps_inti_flags_polarity[polarity], | 134 | mps_inti_flags_trigger[trigger], |
144 | mps_inti_flags_trigger[trigger], | 135 | p->lint); |
145 | p->lint); | ||
146 | } | 136 | } |
147 | break; | 137 | break; |
148 | 138 | ||
@@ -150,9 +140,8 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) | |||
150 | { | 140 | { |
151 | struct acpi_madt_local_apic_override *p = | 141 | struct acpi_madt_local_apic_override *p = |
152 | (struct acpi_madt_local_apic_override *)header; | 142 | (struct acpi_madt_local_apic_override *)header; |
153 | printk(KERN_INFO PREFIX | 143 | pr_info("LAPIC_ADDR_OVR (address[%p])\n", |
154 | "LAPIC_ADDR_OVR (address[%p])\n", | 144 | (void *)(unsigned long)p->address); |
155 | (void *)(unsigned long)p->address); | ||
156 | } | 145 | } |
157 | break; | 146 | break; |
158 | 147 | ||
@@ -160,10 +149,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) | |||
160 | { | 149 | { |
161 | struct acpi_madt_io_sapic *p = | 150 | struct acpi_madt_io_sapic *p = |
162 | (struct acpi_madt_io_sapic *)header; | 151 | (struct acpi_madt_io_sapic *)header; |
163 | printk(KERN_INFO PREFIX | 152 | pr_info("IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n", |
164 | "IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n", | 153 | p->id, (void *)(unsigned long)p->address, |
165 | p->id, (void *)(unsigned long)p->address, | 154 | p->global_irq_base); |
166 | p->global_irq_base); | ||
167 | } | 155 | } |
168 | break; | 156 | break; |
169 | 157 | ||
@@ -171,10 +159,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) | |||
171 | { | 159 | { |
172 | struct acpi_madt_local_sapic *p = | 160 | struct acpi_madt_local_sapic *p = |
173 | (struct acpi_madt_local_sapic *)header; | 161 | (struct acpi_madt_local_sapic *)header; |
174 | printk(KERN_INFO PREFIX | 162 | pr_info("LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n", |
175 | "LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n", | 163 | p->processor_id, p->id, p->eid, |
176 | p->processor_id, p->id, p->eid, | 164 | (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); |
177 | (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); | ||
178 | } | 165 | } |
179 | break; | 166 | break; |
180 | 167 | ||
@@ -182,19 +169,17 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) | |||
182 | { | 169 | { |
183 | struct acpi_madt_interrupt_source *p = | 170 | struct acpi_madt_interrupt_source *p = |
184 | (struct acpi_madt_interrupt_source *)header; | 171 | (struct acpi_madt_interrupt_source *)header; |
185 | printk(KERN_INFO PREFIX | 172 | pr_info("PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n", |
186 | "PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n", | 173 | mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], |
187 | mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], | 174 | mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], |
188 | mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], | 175 | p->type, p->id, p->eid, p->io_sapic_vector, |
189 | p->type, p->id, p->eid, p->io_sapic_vector, | 176 | p->global_irq); |
190 | p->global_irq); | ||
191 | } | 177 | } |
192 | break; | 178 | break; |
193 | 179 | ||
194 | default: | 180 | default: |
195 | printk(KERN_WARNING PREFIX | 181 | pr_warn("Found unsupported MADT entry (type = 0x%x)\n", |
196 | "Found unsupported MADT entry (type = 0x%x)\n", | 182 | header->type); |
197 | header->type); | ||
198 | break; | 183 | break; |
199 | } | 184 | } |
200 | } | 185 | } |
@@ -225,7 +210,7 @@ acpi_table_parse_entries(char *id, | |||
225 | acpi_get_table_with_size(id, 0, &table_header, &tbl_size); | 210 | acpi_get_table_with_size(id, 0, &table_header, &tbl_size); |
226 | 211 | ||
227 | if (!table_header) { | 212 | if (!table_header) { |
228 | printk(KERN_WARNING PREFIX "%4.4s not present\n", id); | 213 | pr_warn("%4.4s not present\n", id); |
229 | return -ENODEV; | 214 | return -ENODEV; |
230 | } | 215 | } |
231 | 216 | ||
@@ -248,7 +233,7 @@ acpi_table_parse_entries(char *id, | |||
248 | * infinite loop. | 233 | * infinite loop. |
249 | */ | 234 | */ |
250 | if (entry->length == 0) { | 235 | if (entry->length == 0) { |
251 | pr_err(PREFIX "[%4.4s:0x%02x] Invalid zero length\n", id, entry_id); | 236 | pr_err("[%4.4s:0x%02x] Invalid zero length\n", id, entry_id); |
252 | goto err; | 237 | goto err; |
253 | } | 238 | } |
254 | 239 | ||
@@ -256,8 +241,8 @@ acpi_table_parse_entries(char *id, | |||
256 | ((unsigned long)entry + entry->length); | 241 | ((unsigned long)entry + entry->length); |
257 | } | 242 | } |
258 | if (max_entries && count > max_entries) { | 243 | if (max_entries && count > max_entries) { |
259 | printk(KERN_WARNING PREFIX "[%4.4s:0x%02x] ignored %i entries of " | 244 | pr_warn("[%4.4s:0x%02x] ignored %i entries of %i found\n", |
260 | "%i found\n", id, entry_id, count - max_entries, count); | 245 | id, entry_id, count - max_entries, count); |
261 | } | 246 | } |
262 | 247 | ||
263 | early_acpi_os_unmap_memory((char *)table_header, tbl_size); | 248 | early_acpi_os_unmap_memory((char *)table_header, tbl_size); |
@@ -322,13 +307,11 @@ static void __init check_multiple_madt(void) | |||
322 | 307 | ||
323 | acpi_get_table_with_size(ACPI_SIG_MADT, 2, &table, &tbl_size); | 308 | acpi_get_table_with_size(ACPI_SIG_MADT, 2, &table, &tbl_size); |
324 | if (table) { | 309 | if (table) { |
325 | printk(KERN_WARNING PREFIX | 310 | pr_warn("BIOS bug: multiple APIC/MADT found, using %d\n", |
326 | "BIOS bug: multiple APIC/MADT found," | 311 | acpi_apic_instance); |
327 | " using %d\n", acpi_apic_instance); | 312 | pr_warn("If \"acpi_apic_instance=%d\" works better, " |
328 | printk(KERN_WARNING PREFIX | 313 | "notify linux-acpi@vger.kernel.org\n", |
329 | "If \"acpi_apic_instance=%d\" works better, " | 314 | acpi_apic_instance ? 0 : 2); |
330 | "notify linux-acpi@vger.kernel.org\n", | ||
331 | acpi_apic_instance ? 0 : 2); | ||
332 | early_acpi_os_unmap_memory(table, tbl_size); | 315 | early_acpi_os_unmap_memory(table, tbl_size); |
333 | 316 | ||
334 | } else | 317 | } else |
@@ -365,8 +348,7 @@ static int __init acpi_parse_apic_instance(char *str) | |||
365 | 348 | ||
366 | acpi_apic_instance = simple_strtoul(str, NULL, 0); | 349 | acpi_apic_instance = simple_strtoul(str, NULL, 0); |
367 | 350 | ||
368 | printk(KERN_NOTICE PREFIX "Shall use APIC/MADT table %d\n", | 351 | pr_notice("Shall use APIC/MADT table %d\n", acpi_apic_instance); |
369 | acpi_apic_instance); | ||
370 | 352 | ||
371 | return 0; | 353 | return 0; |
372 | } | 354 | } |