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

ACPI: scan: Clean up printing messages

Replace all of the ACPI_DEBUG_PRINT() and ACPI_EXCEPTION() instances
in scan.c with acpi_handle_debug() and acpi_handle_info(), respectively,
and drop the _COMPONENT and ACPI_MODULE_NAME() definitions that
are not used any more.

While at it, drop the redundant "Memory allocation error" message
from acpi_add_single_object() and clean up the list of local variables
in that function.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reported-by: kernel test robot <lkp@intel.com>

+12 -17
+12 -17
drivers/acpi/scan.c
··· 19 19 20 20 #include "internal.h" 21 21 22 - #define _COMPONENT ACPI_BUS_COMPONENT 23 - ACPI_MODULE_NAME("scan"); 24 22 extern struct acpi_device *acpi_root; 25 23 26 24 #define ACPI_BUS_CLASS "system_bus" ··· 263 265 return error; 264 266 } 265 267 266 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 267 - "Hot-removing device %s...\n", dev_name(&device->dev))); 268 + acpi_handle_debug(handle, "Ejecting\n"); 268 269 269 270 acpi_bus_trim(device); 270 271 ··· 826 829 /* _PRW */ 827 830 status = acpi_evaluate_object(handle, "_PRW", NULL, &buffer); 828 831 if (ACPI_FAILURE(status)) { 829 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRW")); 832 + acpi_handle_info(handle, "_PRW evaluation failed: %s\n", 833 + acpi_format_exception(status)); 830 834 return err; 831 835 } 832 836 ··· 932 934 933 935 err = acpi_bus_extract_wakeup_device_power_package(device); 934 936 if (err) { 935 - dev_err(&device->dev, "_PRW evaluation error: %d\n", err); 937 + dev_err(&device->dev, "Unable to extract wakeup power resources"); 936 938 return; 937 939 } 938 940 ··· 1168 1170 1169 1171 if (acpi_has_method(handle, "_BCM") && 1170 1172 acpi_has_method(handle, "_BCL")) { 1171 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found generic backlight " 1172 - "support\n")); 1173 + acpi_handle_debug(handle, "Found generic backlight support\n"); 1173 1174 *cap |= ACPI_VIDEO_BACKLIGHT; 1174 1175 /* We have backlight support, no need to scan further */ 1175 1176 return AE_CTRL_TERMINATE; ··· 1659 1662 acpi_handle handle, int type, 1660 1663 unsigned long long sta) 1661 1664 { 1662 - int result; 1663 - struct acpi_device *device; 1664 - struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 1665 1665 struct acpi_device_info *info = NULL; 1666 + struct acpi_device *device; 1667 + int result; 1666 1668 1667 1669 if (handle != ACPI_ROOT_OBJECT && type == ACPI_BUS_TYPE_DEVICE) 1668 1670 acpi_get_object_info(handle, &info); 1669 1671 1670 1672 device = kzalloc(sizeof(struct acpi_device), GFP_KERNEL); 1671 1673 if (!device) { 1672 - printk(KERN_ERR PREFIX "Memory allocation error\n"); 1673 1674 kfree(info); 1674 1675 return -ENOMEM; 1675 1676 } ··· 1694 1699 1695 1700 acpi_power_add_remove_device(device, true); 1696 1701 acpi_device_add_finalize(device); 1697 - acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); 1698 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Added %s [%s] parent %s\n", 1699 - dev_name(&device->dev), (char *) buffer.pointer, 1700 - device->parent ? dev_name(&device->parent->dev) : "(null)")); 1701 - kfree(buffer.pointer); 1702 + 1703 + acpi_handle_debug(handle, "Added as %s, parent %s\n", 1704 + dev_name(&device->dev), device->parent ? 1705 + dev_name(&device->parent->dev) : "(null)"); 1706 + 1702 1707 *child = device; 1703 1708 return 0; 1704 1709 }