]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ACPI: driver: Do not set acpi_device_name() unnecessarily
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 13 Mar 2026 12:58:30 +0000 (13:58 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 13 Mar 2026 15:48:23 +0000 (16:48 +0100)
commit97892d5f0690f588bbcf755efe922c72cd248639
tree327f1842704161161000fe7834d40cbb37b073f7
parent6a8e793ca8db1546d05071ba0807cbf8c4f44a8b
ACPI: driver: Do not set acpi_device_name() unnecessarily

ACPI drivers usually set acpi_device_name() for the given struct
acpi_device to whatever they like, but that value is never used unless
the driver itself uses it and, quite unfortunately, drivers neglect to
clear it on remove.  Some drivers use it for printing messages or
initializing the names of subordinate devices, but it is better to use
string literals for that, especially if the given one is used just once.

To eliminate unnecessary overhead related to acpi_device_name()
handling, rework multiple core ACPI device drivers to stop setting
acpi_device_name() for struct acpi_device objects manipulated
by them and use a string literal instead of it where applicable.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/10840483.nUPlyArG6x@rafael.j.wysocki
15 files changed:
drivers/acpi/ac.c
drivers/acpi/acpi_memhotplug.c
drivers/acpi/acpi_pad.c
drivers/acpi/acpi_processor.c
drivers/acpi/acpi_video.c
drivers/acpi/battery.c
drivers/acpi/button.c
drivers/acpi/ec.c
drivers/acpi/pci_link.c
drivers/acpi/pci_root.c
drivers/acpi/power.c
drivers/acpi/sbs.c
drivers/acpi/sbshc.c
drivers/acpi/thermal.c
include/acpi/processor.h