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

ACPI: PCI: IRQ: Consolidate printing diagnostic messages

The code in pci_irq.c prints diagnostic messages using different
and inconsistent methods. The majority of them are printed with
the help of the dev_*() familiy of logging functions, but
ACPI_DEBUG_PRINT() and ACPI_DEBUG_PRINT_RAW() are still used in
some places which requires the ACPICA debug to be enabled
additionally which is a nuisance and one message is printed
using the raw printk().

To consolidate the printing of messages in that code, convert all of
the ACPI_DEBUG_PRINT() instances in it into dev_dbg(), which is
consistent with the way the other messages are printed by it,
replace the only ACPI_DEBUG_PRINT_RAW() instance with pr_debug() and
make it use pr_warn() istead of printk(KERN_WARNING ).

Also add a pr_fmt() definition to that file and drop the
_COMPONENT and ACPI_MODULE_NAME() definitions that are not used
any more after the above changes.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>

+10 -24
+10 -24
drivers/acpi/pci_irq.c
··· 9 9 * Bjorn Helgaas <bjorn.helgaas@hp.com> 10 10 */ 11 11 12 + #define pr_fmt(fmt) "ACPI: PCI: " fmt 12 13 13 14 #include <linux/dmi.h> 14 15 #include <linux/kernel.h> ··· 22 21 #include <linux/acpi.h> 23 22 #include <linux/slab.h> 24 23 #include <linux/interrupt.h> 25 - 26 - #define PREFIX "ACPI: " 27 - 28 - #define _COMPONENT ACPI_PCI_COMPONENT 29 - ACPI_MODULE_NAME("pci_irq"); 30 24 31 25 struct acpi_prt_entry { 32 26 struct acpi_pci_id id; ··· 122 126 entry->pin == quirk->pin && 123 127 !strcmp(prt->source, quirk->source) && 124 128 strlen(prt->source) >= strlen(quirk->actual_source)) { 125 - printk(KERN_WARNING PREFIX "firmware reports " 129 + pr_warn("Firmware reports " 126 130 "%04x:%02x:%02x PCI INT %c connected to %s; " 127 131 "changing to %s\n", 128 132 entry->id.segment, entry->id.bus, ··· 187 191 * the IRQ value, which is hardwired to specific interrupt inputs on 188 192 * the interrupt controller. 189 193 */ 190 - 191 - ACPI_DEBUG_PRINT_RAW((ACPI_DB_INFO, 192 - " %04x:%02x:%02x[%c] -> %s[%d]\n", 193 - entry->id.segment, entry->id.bus, 194 - entry->id.device, pin_name(entry->pin), 195 - prt->source, entry->index)); 194 + pr_debug("%04x:%02x:%02x[%c] -> %s[%d]\n", 195 + entry->id.segment, entry->id.bus, entry->id.device, 196 + pin_name(entry->pin), prt->source, entry->index); 196 197 197 198 *entry_ptr = entry; 198 199 ··· 300 307 #ifdef CONFIG_X86_IO_APIC 301 308 acpi_reroute_boot_interrupt(dev, entry); 302 309 #endif /* CONFIG_X86_IO_APIC */ 303 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %s[%c] _PRT entry\n", 304 - pci_name(dev), pin_name(pin))); 310 + dev_dbg(&dev->dev, "Found [%c] _PRT entry\n", pin_name(pin)); 305 311 return entry; 306 312 } 307 313 ··· 316 324 /* PC card has the same IRQ as its cardbridge */ 317 325 bridge_pin = bridge->pin; 318 326 if (!bridge_pin) { 319 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 320 - "No interrupt pin configured for device %s\n", 321 - pci_name(bridge))); 327 + dev_dbg(&bridge->dev, "No interrupt pin configured\n"); 322 328 return NULL; 323 329 } 324 330 pin = bridge_pin; ··· 324 334 325 335 ret = acpi_pci_irq_find_prt_entry(bridge, pin, &entry); 326 336 if (!ret && entry) { 327 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 328 - "Derived GSI for %s INT %c from %s\n", 329 - pci_name(dev), pin_name(orig_pin), 330 - pci_name(bridge))); 337 + dev_dbg(&dev->dev, "Derived GSI INT %c from %s\n", 338 + pin_name(orig_pin), pci_name(bridge)); 331 339 return entry; 332 340 } 333 341 ··· 401 413 402 414 pin = dev->pin; 403 415 if (!pin) { 404 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 405 - "No interrupt pin configured for device %s\n", 406 - pci_name(dev))); 416 + dev_dbg(&dev->dev, "No interrupt pin configured\n"); 407 417 return 0; 408 418 } 409 419