From: Jerry Snitselaar <jsnitsel@redhat.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
linux-mmc@vger.kernel.org,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Adrian Hunter <adrian.hunter@intel.com>,
linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org,
Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH v3 6/6] iommu/amd: Switch to use acpi_dev_hid_uid_match()
Date: Tue, 8 Oct 2019 14:46:09 -0700 [thread overview]
Message-ID: <20191008214609.wk2imvejk2h2pvil@cantor> (raw)
In-Reply-To: <20191001142725.30857-7-andriy.shevchenko@linux.intel.com>
On Tue Oct 01 19, Andy Shevchenko wrote:
>Since we have a generic helper, drop custom implementation in the driver.
>
>Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
>---
> drivers/iommu/amd_iommu.c | 30 +++++-------------------------
> 1 file changed, 5 insertions(+), 25 deletions(-)
>
>diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
>index 2369b8af81f3..40f3cf44aa98 100644
>--- a/drivers/iommu/amd_iommu.c
>+++ b/drivers/iommu/amd_iommu.c
>@@ -124,30 +124,6 @@ static struct lock_class_key reserved_rbtree_key;
> *
> ****************************************************************************/
>
>-static inline int match_hid_uid(struct device *dev,
>- struct acpihid_map_entry *entry)
>-{
>- struct acpi_device *adev = ACPI_COMPANION(dev);
>- const char *hid, *uid;
>-
>- if (!adev)
>- return -ENODEV;
>-
>- hid = acpi_device_hid(adev);
>- uid = acpi_device_uid(adev);
>-
>- if (!hid || !(*hid))
>- return -ENODEV;
>-
>- if (!uid || !(*uid))
>- return strcmp(hid, entry->hid);
>-
>- if (!(*entry->uid))
>- return strcmp(hid, entry->hid);
>-
>- return (strcmp(hid, entry->hid) || strcmp(uid, entry->uid));
>-}
>-
> static inline u16 get_pci_device_id(struct device *dev)
> {
> struct pci_dev *pdev = to_pci_dev(dev);
>@@ -158,10 +134,14 @@ static inline u16 get_pci_device_id(struct device *dev)
> static inline int get_acpihid_device_id(struct device *dev,
> struct acpihid_map_entry **entry)
> {
>+ struct acpi_device *adev = ACPI_COMPANION(dev);
> struct acpihid_map_entry *p;
>
>+ if (!adev)
>+ return -ENODEV;
>+
> list_for_each_entry(p, &acpihid_map, list) {
>- if (!match_hid_uid(dev, p)) {
>+ if (acpi_dev_hid_uid_match(adev, p->hid, p->uid)) {
> if (entry)
> *entry = p;
> return p->devid;
>--
>2.23.0
>
>_______________________________________________
>iommu mailing list
>iommu@lists.linux-foundation.org
>https://lists.linuxfoundation.org/mailman/listinfo/iommu
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2019-10-08 21:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-01 14:27 [PATCH v3 0/6] ACPI / utils: add new helper for HID/UID match Andy Shevchenko
2019-10-01 14:27 ` [PATCH v3 1/6] ACPI / utils: Describe function parameters in kernel-doc Andy Shevchenko
2019-10-01 14:27 ` [PATCH v3 2/6] ACPI / utils: Move acpi_dev_get_first_match_dev() under CONFIG_ACPI Andy Shevchenko
2019-10-01 14:27 ` [PATCH v3 3/6] ACPI / utils: Introduce acpi_dev_hid_uid_match() helper Andy Shevchenko
2019-10-01 14:27 ` [PATCH v3 4/6] ACPI / LPSS: Switch to use acpi_dev_hid_uid_match() Andy Shevchenko
2019-10-01 14:27 ` [PATCH v3 5/6] mmc: sdhci-acpi: " Andy Shevchenko
2019-10-02 11:16 ` Adrian Hunter
2019-10-01 14:27 ` [PATCH v3 6/6] iommu/amd: " Andy Shevchenko
2019-10-08 21:46 ` Jerry Snitselaar [this message]
2019-10-03 10:00 ` [PATCH v3 0/6] ACPI / utils: add new helper for HID/UID match Ulf Hansson
2019-10-03 10:17 ` Andy Shevchenko
2019-10-11 9:16 ` Rafael J. Wysocki
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=20191008214609.wk2imvejk2h2pvil@cantor \
--to=jsnitsel@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rjw@rjwysocki.net \
--cc=ulf.hansson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).