Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hanjun Guo and committed by
Rafael J. Wysocki
730bf5eb cfbf8d48

+55 -73
+55 -73
drivers/acpi/tables.c
··· 23 23 * 24 24 */ 25 25 26 + #define pr_fmt(fmt) "ACPI: " fmt 27 + 26 28 #include <linux/init.h> 27 29 #include <linux/kernel.h> 28 30 #include <linux/smp.h> ··· 34 32 #include <linux/errno.h> 35 33 #include <linux/acpi.h> 36 34 #include <linux/bootmem.h> 37 - 38 - #define PREFIX "ACPI: " 39 35 40 36 #define ACPI_MAX_TABLES 128 41 37 ··· 55 55 { 56 56 struct acpi_madt_local_apic *p = 57 57 (struct acpi_madt_local_apic *)header; 58 - printk(KERN_INFO PREFIX 59 - "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", 60 - p->processor_id, p->id, 61 - (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); 58 + pr_info("LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", 59 + p->processor_id, p->id, 60 + (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); 62 61 } 63 62 break; 64 63 ··· 65 66 { 66 67 struct acpi_madt_local_x2apic *p = 67 68 (struct acpi_madt_local_x2apic *)header; 68 - printk(KERN_INFO PREFIX 69 - "X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n", 70 - p->local_apic_id, p->uid, 71 - (p->lapic_flags & ACPI_MADT_ENABLED) ? 72 - "enabled" : "disabled"); 69 + pr_info("X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n", 70 + p->local_apic_id, p->uid, 71 + (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); 73 72 } 74 73 break; 75 74 ··· 75 78 { 76 79 struct acpi_madt_io_apic *p = 77 80 (struct acpi_madt_io_apic *)header; 78 - printk(KERN_INFO PREFIX 79 - "IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n", 80 - p->id, p->address, p->global_irq_base); 81 + pr_info("IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n", 82 + p->id, p->address, p->global_irq_base); 81 83 } 82 84 break; 83 85 ··· 84 88 { 85 89 struct acpi_madt_interrupt_override *p = 86 90 (struct acpi_madt_interrupt_override *)header; 87 - printk(KERN_INFO PREFIX 88 - "INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n", 89 - p->bus, p->source_irq, p->global_irq, 90 - mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], 91 - mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2]); 91 + pr_info("INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n", 92 + p->bus, p->source_irq, p->global_irq, 93 + mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], 94 + mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2]); 92 95 if (p->inti_flags & 93 96 ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK)) 94 - printk(KERN_INFO PREFIX 95 - "INT_SRC_OVR unexpected reserved flags: 0x%x\n", 96 - p->inti_flags & 97 + pr_info("INT_SRC_OVR unexpected reserved flags: 0x%x\n", 98 + p->inti_flags & 97 99 ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK)); 98 - 99 100 } 100 101 break; 101 102 ··· 100 107 { 101 108 struct acpi_madt_nmi_source *p = 102 109 (struct acpi_madt_nmi_source *)header; 103 - printk(KERN_INFO PREFIX 104 - "NMI_SRC (%s %s global_irq %d)\n", 105 - mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], 106 - mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], 107 - p->global_irq); 110 + pr_info("NMI_SRC (%s %s global_irq %d)\n", 111 + mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], 112 + mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], 113 + p->global_irq); 108 114 } 109 115 break; 110 116 ··· 111 119 { 112 120 struct acpi_madt_local_apic_nmi *p = 113 121 (struct acpi_madt_local_apic_nmi *)header; 114 - printk(KERN_INFO PREFIX 115 - "LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n", 116 - p->processor_id, 117 - mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK ], 118 - mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], 119 - p->lint); 122 + pr_info("LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n", 123 + p->processor_id, 124 + mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK ], 125 + mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], 126 + p->lint); 120 127 } 121 128 break; 122 129 ··· 128 137 polarity = p->inti_flags & ACPI_MADT_POLARITY_MASK; 129 138 trigger = (p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2; 130 139 131 - printk(KERN_INFO PREFIX 132 - "X2APIC_NMI (uid[0x%02x] %s %s lint[0x%x])\n", 133 - p->uid, 134 - mps_inti_flags_polarity[polarity], 135 - mps_inti_flags_trigger[trigger], 136 - p->lint); 140 + pr_info("X2APIC_NMI (uid[0x%02x] %s %s lint[0x%x])\n", 141 + p->uid, 142 + mps_inti_flags_polarity[polarity], 143 + mps_inti_flags_trigger[trigger], 144 + p->lint); 137 145 } 138 146 break; 139 147 ··· 140 150 { 141 151 struct acpi_madt_local_apic_override *p = 142 152 (struct acpi_madt_local_apic_override *)header; 143 - printk(KERN_INFO PREFIX 144 - "LAPIC_ADDR_OVR (address[%p])\n", 145 - (void *)(unsigned long)p->address); 153 + pr_info("LAPIC_ADDR_OVR (address[%p])\n", 154 + (void *)(unsigned long)p->address); 146 155 } 147 156 break; 148 157 ··· 149 160 { 150 161 struct acpi_madt_io_sapic *p = 151 162 (struct acpi_madt_io_sapic *)header; 152 - printk(KERN_INFO PREFIX 153 - "IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n", 154 - p->id, (void *)(unsigned long)p->address, 155 - p->global_irq_base); 163 + pr_info("IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n", 164 + p->id, (void *)(unsigned long)p->address, 165 + p->global_irq_base); 156 166 } 157 167 break; 158 168 ··· 159 171 { 160 172 struct acpi_madt_local_sapic *p = 161 173 (struct acpi_madt_local_sapic *)header; 162 - printk(KERN_INFO PREFIX 163 - "LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n", 164 - p->processor_id, p->id, p->eid, 165 - (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); 174 + pr_info("LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n", 175 + p->processor_id, p->id, p->eid, 176 + (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); 166 177 } 167 178 break; 168 179 ··· 169 182 { 170 183 struct acpi_madt_interrupt_source *p = 171 184 (struct acpi_madt_interrupt_source *)header; 172 - printk(KERN_INFO PREFIX 173 - "PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n", 174 - mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], 175 - mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], 176 - p->type, p->id, p->eid, p->io_sapic_vector, 177 - p->global_irq); 185 + 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 + mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], 187 + mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], 188 + p->type, p->id, p->eid, p->io_sapic_vector, 189 + p->global_irq); 178 190 } 179 191 break; 180 192 181 193 default: 182 - printk(KERN_WARNING PREFIX 183 - "Found unsupported MADT entry (type = 0x%x)\n", 184 - header->type); 194 + pr_warn("Found unsupported MADT entry (type = 0x%x)\n", 195 + header->type); 185 196 break; 186 197 } 187 198 } ··· 210 225 acpi_get_table_with_size(id, 0, &table_header, &tbl_size); 211 226 212 227 if (!table_header) { 213 - printk(KERN_WARNING PREFIX "%4.4s not present\n", id); 228 + pr_warn("%4.4s not present\n", id); 214 229 return -ENODEV; 215 230 } 216 231 ··· 233 248 * infinite loop. 234 249 */ 235 250 if (entry->length == 0) { 236 - pr_err(PREFIX "[%4.4s:0x%02x] Invalid zero length\n", id, entry_id); 251 + pr_err("[%4.4s:0x%02x] Invalid zero length\n", id, entry_id); 237 252 goto err; 238 253 } 239 254 ··· 241 256 ((unsigned long)entry + entry->length); 242 257 } 243 258 if (max_entries && count > max_entries) { 244 - printk(KERN_WARNING PREFIX "[%4.4s:0x%02x] ignored %i entries of " 245 - "%i found\n", id, entry_id, count - max_entries, count); 259 + pr_warn("[%4.4s:0x%02x] ignored %i entries of %i found\n", 260 + id, entry_id, count - max_entries, count); 246 261 } 247 262 248 263 early_acpi_os_unmap_memory((char *)table_header, tbl_size); ··· 307 322 308 323 acpi_get_table_with_size(ACPI_SIG_MADT, 2, &table, &tbl_size); 309 324 if (table) { 310 - printk(KERN_WARNING PREFIX 311 - "BIOS bug: multiple APIC/MADT found," 312 - " using %d\n", acpi_apic_instance); 313 - printk(KERN_WARNING PREFIX 314 - "If \"acpi_apic_instance=%d\" works better, " 315 - "notify linux-acpi@vger.kernel.org\n", 316 - acpi_apic_instance ? 0 : 2); 325 + pr_warn("BIOS bug: multiple APIC/MADT found, using %d\n", 326 + acpi_apic_instance); 327 + pr_warn("If \"acpi_apic_instance=%d\" works better, " 328 + "notify linux-acpi@vger.kernel.org\n", 329 + acpi_apic_instance ? 0 : 2); 317 330 early_acpi_os_unmap_memory(table, tbl_size); 318 331 319 332 } else ··· 348 365 349 366 acpi_apic_instance = simple_strtoul(str, NULL, 0); 350 367 351 - printk(KERN_NOTICE PREFIX "Shall use APIC/MADT table %d\n", 352 - acpi_apic_instance); 368 + pr_notice("Shall use APIC/MADT table %d\n", acpi_apic_instance); 353 369 354 370 return 0; 355 371 }