Skip to contentSkip to conversation

PCI: acpiphp_ibm: Do not use uninitialized device_class

PATCH Applied Rafael J. Wysocki 4 participants 4 messages Jul 6 – Jul 10

Subsystems (2)
lore
Share & tools
lore

Rafael J. Wysocki

author maintainer
#0 lore raw

PATCH 1/1 PCI: acpiphp_ibm: Do not use uninitialized device_class

From: "Rafael J. Wysocki" <[email protected]>

Passing an uninitialized pnp.device_class string to acpi_bus_generate_netlink_event() is effectively equivalent to passing an empty string literal to it.

Accordingly, make the driver do the latter instead of doing the former.

No intentional functional impact.

This will facilitate the removal of device_class from struct acpi_device_pnp in the future.

---
 drivers/pci/hotplug/acpiphp_ibm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/hotplug/acpiphp_ibm.c +1 -2
index f8016ed24523..7337bd1ac6df 100644
@@ -258,8 +258,7 @@ static void ibm_handle_events(acpi_handle handle, u32 event, void *context)
 
 	if (subevent == 0x80) {
 		pr_debug("%s: generating bus event\n", __func__);
-		acpi_bus_generate_netlink_event(note->device->pnp.device_class,
-						  dev_name(&note->device->dev),
+		acpi_bus_generate_netlink_event("", dev_name(&note->device->dev),
 						  note->event, detail);
 	} else
 		note->event = event;
Signature · 1 line
2.51.0
#1 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 9 lines

From: "Rafael J. Wysocki" <[email protected]>

Passing an uninitialized pnp.device_class string to acpi_bus_generate_netlink_event() is effectively equivalent to passing an empty string literal to it.

Accordingly, make the driver do the latter instead of doing the former.

Quoted 6 lines

No intentional functional impact.

This will facilitate the removal of device_class from struct acpi_device_pnp in the future.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Rafael J. Wysocki
Quoted 11 lines · Rafael J. Wysocki

Passing an uninitialized pnp.device_class string to acpi_bus_generate_netlink_event() is effectively equivalent to passing an empty string literal to it.

Accordingly, make the driver do the latter instead of doing the former.

No intentional functional impact.

This will facilitate the removal of device_class from struct acpi_device_pnp in the future.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
In reply to Rafael J. Wysocki
Quoted 9 lines · Rafael J. Wysocki

From: "Rafael J. Wysocki" <[email protected]>

Passing an uninitialized pnp.device_class string to acpi_bus_generate_netlink_event() is effectively equivalent to passing an empty string literal to it.

Accordingly, make the driver do the latter instead of doing the former.

Quoted 6 lines

No intentional functional impact.

This will facilitate the removal of device_class from struct acpi_device_pnp in the future.

Applied to pci/hotplug for v7.3, thanks!

Quoted 24 lines
---
 drivers/pci/hotplug/acpiphp_ibm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/hotplug/acpiphp_ibm.c +1 -2
index f8016ed24523..7337bd1ac6df 100644
@@ -258,8 +258,7 @@ static void ibm_handle_events(acpi_handle handle, u32 event, void *context)
 
 	if (subevent == 0x80) {
 		pr_debug("%s: generating bus event\n", __func__);
-		acpi_bus_generate_netlink_event(note->device->pnp.device_class,
-						  dev_name(&note->device->dev),
+		acpi_bus_generate_netlink_event("", dev_name(&note->device->dev),
 						  note->event, detail);
 	} else
 		note->event = event;
Signature · 1 line
2.51.0