Skip to contentSkip to conversation

ACPI: Provide !ACPI stub for acpi_device_uid()

PATCH Applied Robin Murphy 2 participants 2 messages Sep 22

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ACPI: Provide !ACPI stub for acpi_device_uid()

While the likes of acpi_dev_uid_to_integer() and acpi_dev_uid_match() already have stubs for !ACPI, the basic acpi_device_uid() getter does not. Although calls in portable drivers should already be conditional on a valid acpi_device in a manner which would usually lead to compile- time elimination anyway, add a stub for the sake of completeness.

---
v2: Distinct non-const definition to avoid further theoretical issues

---
 include/acpi/acpi_bus.h | 5 +++++
 1 file changed, 5 insertions(+)
include/acpi/acpi_bus.h +5 -0
index 1a45e0d521d8..d686d09f1678 100644
@@ -964,6 +964,11 @@ static inline const char *acpi_device_hid(struct acpi_device *device)
 	return "";
 }
 
+static inline char *acpi_device_uid(struct acpi_device *device)
+{
+	return NULL;
+}
+
 static inline bool
 acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld)
 {
Signature · 1 line
2.54.0.dirty
maintainer Applied
#1 lore raw
Quoted 22 lines · Robin Murphy

While the likes of acpi_dev_uid_to_integer() and acpi_dev_uid_match() already have stubs for !ACPI, the basic acpi_device_uid() getter does not. Although calls in portable drivers should already be conditional on a valid acpi_device in a manner which would usually lead to compile- time elimination anyway, add a stub for the sake of completeness.

---
v2: Distinct non-const definition to avoid further theoretical issues

---
 include/acpi/acpi_bus.h | 5 +++++
 1 file changed, 5 insertions(+)
include/acpi/acpi_bus.h +0 -0
index 1a45e0d521d8..d686d09f1678 100644
@@ -964,6 +964,11 @@ static inline const char *acpi_device_hid(struct acpi_device *device)
        return "";
 }

include/acpi/acpi_bus.h static inline const char *acpi_device_hid(struct acpi_device *device)

Quoted 10 lines
include/acpi/acpi_bus.h +5 -1
 
+static inline char *acpi_device_uid(struct acpi_device *device)
+{
+       return NULL;
+}
+
 static inline bool
 acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld)
 {
--

Applied as 7.4 material, thanks!