diff mbox series

acpi: uniqueid: skip comparison of _HID and _CID of the same device

Message ID 20211018214837.1830678-1-alex.hung@canonical.com
State Accepted
Headers show
Series acpi: uniqueid: skip comparison of _HID and _CID of the same device | expand

Commit Message

Alex Hung Oct. 18, 2021, 9:48 p.m. UTC
Buglink: https://bugs.launchpad.net/bugs/1947633

Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/acpi/uniqueid/uniqueid.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

ivanhu Oct. 19, 2021, 7:04 a.m. UTC | #1
On 10/19/21 5:48 AM, Alex Hung wrote:
> Buglink: https://bugs.launchpad.net/bugs/1947633
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/uniqueid/uniqueid.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/acpi/uniqueid/uniqueid.c b/src/acpi/uniqueid/uniqueid.c
> index 57a16092..f745dfe5 100644
> --- a/src/acpi/uniqueid/uniqueid.c
> +++ b/src/acpi/uniqueid/uniqueid.c
> @@ -108,6 +108,10 @@ static bool is_uniqueid_equal(acpi_ids *obj1, acpi_ids *obj2)
>  {
>  	bool hid_match = false;
>  
> +	/* _HID and _CID are in the same device */
> +	if (!strncmp(obj1->hid_name, obj2->hid_name, strlen(obj1->hid_name) - 4))
> +		return false;
> +
>  	if (obj1 == NULL || obj2 == NULL)
>  		return false;
>  
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/acpi/uniqueid/uniqueid.c b/src/acpi/uniqueid/uniqueid.c
index 57a16092..f745dfe5 100644
--- a/src/acpi/uniqueid/uniqueid.c
+++ b/src/acpi/uniqueid/uniqueid.c
@@ -108,6 +108,10 @@  static bool is_uniqueid_equal(acpi_ids *obj1, acpi_ids *obj2)
 {
 	bool hid_match = false;
 
+	/* _HID and _CID are in the same device */
+	if (!strncmp(obj1->hid_name, obj2->hid_name, strlen(obj1->hid_name) - 4))
+		return false;
+
 	if (obj1 == NULL || obj2 == NULL)
 		return false;