From patchwork Mon Oct 18 21:48:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1542884 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=L98zt5Zi; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HY9W64vMRz9sNH for ; Tue, 19 Oct 2021 08:49:05 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mcaV9-0003hN-O2; Mon, 18 Oct 2021 21:48:59 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mcaV7-0003hG-2j for fwts-devel@lists.ubuntu.com; Mon, 18 Oct 2021 21:48:57 +0000 Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id DE6F93F4A4 for ; Mon, 18 Oct 2021 21:48:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1634593736; bh=7he54ig+gumdCZPV438VlFhr1CsHEhHHdXsc9v0glJY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=L98zt5ZiO91l41Wcm0hCgPTbSdn57n4fyTqigVwOF/G9pVd5afn7njskOdb9Gxjd3 D5JtPYgxicBAPLmLsvR2gMrfnQGAcHMHd44Ht+oz9beU126kRqQn+uePH581TF50SN uYLy2yhPnkwTQbC3EFg603T3zaVRjDALbpwWf7GHXEhwQFbng/5k89bvPmnKmaFkkd Nf7OmDQqrXN48NTYY3aBjxghcVOXdhGEx0gPII+cbcFva/5OGkKpo0BBgXWiovMGVp e/MB3ldAuqSXY685KJs0ShUpT0yWHh3ahwdi15nS3Mdw7GTm+xBzlWIfG98MwwtlzC qarJoZKKEHMrQ== Received: by mail-pl1-f197.google.com with SMTP id y13-20020a1709029b8d00b0013dc7c668e2so6973102plp.16 for ; Mon, 18 Oct 2021 14:48:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7he54ig+gumdCZPV438VlFhr1CsHEhHHdXsc9v0glJY=; b=yxx8OR+E0b9qobfzenO3H7I9fQWnzptsQC9MdaCwBcsHVYFxlmHQPQ0jzYA+DFVrYk aaIoOGkiO1yy5MtqM+QnMQqZGWRMLU6WaT6vKs41fJR8IacBx7fhs9okcYvSEKD2FKtE MQosUjx1R4VrfRIwJiglnagRLGYOBV3ZH1uFVlPohZxSIZ0CojFmGQRwATmcwpZUT+vr Fy1FTbI/KA81rMdzEP0mya5qN72IpPz+NG2RRbUl7GLz3ZqHcuiq2zMrZDDJbHNemveU o0+LwGDzAnIXnaX5l4zeWdfE/qPG3+9TsC0ose3DnDAXKI1D5Vj+nmx69Vl+g1eNsIl6 kj4Q== X-Gm-Message-State: AOAM530nvVCE15aO3FBmbnFjdVMkLgg3TraQUFOdgPirzKLRtC8y2S8W OGQoTQ48sMN1gKMCdJydsTAELJE+IOAKhEpc1OhtxfLDj8qruJqMQfqJDFWzXgRxSlVlXvrz5wo irtBldrbA779pPQaMHjOjlkMbqKoYzc1coTnaJD3x X-Received: by 2002:a63:6a05:: with SMTP id f5mr25196635pgc.398.1634593734887; Mon, 18 Oct 2021 14:48:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdPMcsl+XcBCBGR1kgNw7FCm5JOHFlcBUlfzllyg5heQUOCFhTX/NVZcoFS6r//EDX/5758g== X-Received: by 2002:a63:6a05:: with SMTP id f5mr25196607pgc.398.1634593734496; Mon, 18 Oct 2021 14:48:54 -0700 (PDT) Received: from canonical.com (node-1w7jr9yebujeq5th4a1ypmehf.ipv6.telus.net. [2001:56a:78ed:fb00::3d3]) by smtp.gmail.com with ESMTPSA id z2sm14494972pfe.210.2021.10.18.14.48.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 14:48:54 -0700 (PDT) From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpi: uniqueid: skip comparison of _HID and _CID of the same device Date: Mon, 18 Oct 2021 15:48:37 -0600 Message-Id: <20211018214837.1830678-1-alex.hung@canonical.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Buglink: https://bugs.launchpad.net/bugs/1947633 Signed-off-by: Alex Hung Acked-by: Ivan Hu --- 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;