@@ -911,17 +911,19 @@ static inline bool acpi_int_uid_match(struct acpi_device *adev, u64 uid2)
911
911
* acpi_dev_hid_uid_match - Match device by supplied HID and UID
912
912
* @adev: ACPI device to match.
913
913
* @hid2: Hardware ID of the device.
914
- * @uid2: Unique ID of the device, pass 0 or NULL to not check _UID.
914
+ * @uid2: Unique ID of the device, pass NULL to not check _UID.
915
915
*
916
916
* Matches HID and UID in @adev with given @hid2 and @uid2. Absence of @uid2
917
917
* will be treated as a match. If user wants to validate @uid2, it should be
918
918
* done before calling this function.
919
919
*
920
- * Returns: %true if matches or @uid2 is 0 or NULL, %false otherwise.
920
+ * Returns: %true if matches or @uid2 is NULL, %false otherwise.
921
921
*/
922
922
#define acpi_dev_hid_uid_match (adev , hid2 , uid2 ) \
923
923
(acpi_dev_hid_match(adev, hid2) && \
924
- (!(uid2) || acpi_dev_uid_match(adev, uid2)))
924
+ /* Distinguish integer 0 from NULL @uid2 */ \
925
+ (_Generic(uid2 , ACPI_STR_TYPES (!(uid2 )), default : 0 ) || \
926
+ acpi_dev_uid_match (adev , uid2 )))
925
927
926
928
void acpi_dev_clear_dependencies (struct acpi_device * supplier );
927
929
bool acpi_dev_ready_for_enumeration (const struct acpi_device * device );
0 commit comments