diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-04-11 20:36:35 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-04-11 20:36:35 +0300 |
commit | d7da7e7cec9868b24f0e39298156caf0277e82c7 (patch) | |
tree | 3adcedbd150d5908d0a0c465f609a5ce94ec4d75 | |
parent | d730192ff0246356a2d7e63ff5bd501060670eec (diff) | |
parent | aca1a5287ea328fd1f7e2bfa6806646486d86a70 (diff) | |
download | linux-d7da7e7cec9868b24f0e39298156caf0277e82c7.tar.xz |
Merge branch 'acpi-bus'
* acpi-bus:
ACPI: bus: allow _UID matching for integer zero
-rw-r--r-- | include/acpi/acpi_bus.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 5de954e2b18a..e7796f373d0d 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -911,17 +911,19 @@ static inline bool acpi_int_uid_match(struct acpi_device *adev, u64 uid2) * acpi_dev_hid_uid_match - Match device by supplied HID and UID * @adev: ACPI device to match. * @hid2: Hardware ID of the device. - * @uid2: Unique ID of the device, pass 0 or NULL to not check _UID. + * @uid2: Unique ID of the device, pass NULL to not check _UID. * * Matches HID and UID in @adev with given @hid2 and @uid2. Absence of @uid2 * will be treated as a match. If user wants to validate @uid2, it should be * done before calling this function. * - * Returns: %true if matches or @uid2 is 0 or NULL, %false otherwise. + * Returns: %true if matches or @uid2 is NULL, %false otherwise. */ #define acpi_dev_hid_uid_match(adev, hid2, uid2) \ (acpi_dev_hid_match(adev, hid2) && \ - (!(uid2) || acpi_dev_uid_match(adev, uid2))) + /* Distinguish integer 0 from NULL @uid2 */ \ + (_Generic(uid2, ACPI_STR_TYPES(!(uid2)), default: 0) || \ + acpi_dev_uid_match(adev, uid2))) void acpi_dev_clear_dependencies(struct acpi_device *supplier); bool acpi_dev_ready_for_enumeration(const struct acpi_device *device); |