From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Mark Gross <markgross@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 2/2] platform/x86: wmi: Replace open coded guid_parse_and_compare()
Date: Wed, 21 Jun 2023 18:11:55 +0300 [thread overview]
Message-ID: <20230621151155.78279-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20230621151155.78279-1-andriy.shevchenko@linux.intel.com>
Even though we have no issues in the code, let's replace the open
coded guid_parse_and_compare().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/platform/x86/wmi.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 098512a53170..a78ddd83cda0 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -1241,11 +1241,7 @@ static bool guid_already_parsed_for_legacy(struct acpi_device *device, const gui
list_for_each_entry(wblock, &wmi_block_list, list) {
/* skip warning and register if we know the driver will use struct wmi_driver */
for (int i = 0; allow_duplicates[i] != NULL; i++) {
- guid_t tmp;
-
- if (guid_parse(allow_duplicates[i], &tmp))
- continue;
- if (guid_equal(&tmp, guid))
+ if (guid_parse_and_compare(allow_duplicates[i], guid))
return false;
}
if (guid_equal(&wblock->gblock.guid, guid)) {
--
2.40.0.1.gaa8946217a0b
next prev parent reply other threads:[~2023-06-21 15:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-21 15:11 [PATCH v1 1/2] platform/x86: wmi: Break possible infinite loop when parsing GUID Andy Shevchenko
2023-06-21 15:11 ` Andy Shevchenko [this message]
2023-06-21 21:21 ` [PATCH v1 2/2] platform/x86: wmi: Replace open coded guid_parse_and_compare() Armin Wolf
2023-06-21 21:20 ` [PATCH v1 1/2] platform/x86: wmi: Break possible infinite loop when parsing GUID Armin Wolf
2023-06-21 21:29 ` Barnabás Pőcze
2023-06-21 21:50 ` Armin Wolf
2023-06-22 8:43 ` Andy Shevchenko
2023-06-22 15:00 ` Andy Shevchenko
2023-07-04 11:02 ` Hans de Goede
2023-07-06 10:49 ` Andy Shevchenko
2023-06-22 8:44 ` Andy Shevchenko
2023-07-11 9:36 ` Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230621151155.78279-2-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.