From: Robin Murphy <robin.murphy@arm.com>
To: Will Deacon <will@kernel.org>, Joerg Roedel <joro@8bytes.org>
Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, iommu@lists.linux.dev,
devicetree@vger.kernel.org, Rob Herring <robh@kernel.org>,
Saravana Kannan <saravanak@google.com>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Hanjun Guo <guohanjun@huawei.com>,
Sudeep Holla <sudeep.holla@arm.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
Jean-Philippe Brucker <jean-philippe@linaro.org>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
Yong Wu <yong.wu@mediatek.com>, kernel test robot <lkp@intel.com>
Subject: [PATCH v3 1/5] iommu/mediatek-v1: Clean up redundant fwspec checks
Date: Tue, 2 Jul 2024 12:40:47 +0100 [thread overview]
Message-ID: <7d6ebec135483f889af00eb376aa31c012efc3b2.1719919669.git.robin.murphy@arm.com> (raw)
In-Reply-To: <cover.1719919669.git.robin.murphy@arm.com>
The driver explicitly clears any existing fwspec before calling
mtk_iommu_v1_create_mapping(), but even if it didn't, the checks it's
doing there duplicate what iommu_fwspec_init() would do anyway. Clean
them up.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202407020415.KKnhPTUj-lkp@intel.com/
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
drivers/iommu/mtk_iommu_v1.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c
index d6e4002200bd..2b64ea46318f 100644
--- a/drivers/iommu/mtk_iommu_v1.c
+++ b/drivers/iommu/mtk_iommu_v1.c
@@ -401,7 +401,6 @@ static const struct iommu_ops mtk_iommu_v1_ops;
static int mtk_iommu_v1_create_mapping(struct device *dev,
const struct of_phandle_args *args)
{
- struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
struct mtk_iommu_v1_data *data;
struct platform_device *m4updev;
struct dma_iommu_mapping *mtk_mapping;
@@ -413,14 +412,9 @@ static int mtk_iommu_v1_create_mapping(struct device *dev,
return -EINVAL;
}
- if (!fwspec) {
- ret = iommu_fwspec_init(dev, &args->np->fwnode, &mtk_iommu_v1_ops);
- if (ret)
- return ret;
- fwspec = dev_iommu_fwspec_get(dev);
- } else if (dev_iommu_fwspec_get(dev)->ops != &mtk_iommu_v1_ops) {
- return -EINVAL;
- }
+ ret = iommu_fwspec_init(dev, &args->np->fwnode, &mtk_iommu_v1_ops);
+ if (ret)
+ return ret;
if (!dev_iommu_priv_get(dev)) {
/* Get the m4u device */
--
2.39.2.101.g768bb238c484.dirty
next prev parent reply other threads:[~2024-07-02 11:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 11:40 [PATCH v3 0/5] iommu: Remove iommu_fwspec ops Robin Murphy
2024-07-02 11:40 ` Robin Murphy [this message]
2024-07-02 11:40 ` [PATCH v3 2/5] iommu: Resolve fwspec ops automatically Robin Murphy
2024-07-12 11:01 ` Jon Hunter
2024-07-12 11:48 ` Robin Murphy
2024-07-12 15:24 ` Jon Hunter
2024-07-12 15:26 ` Will Deacon
2024-07-12 15:28 ` Robin Murphy
2024-07-12 15:31 ` Will Deacon
2024-07-12 15:34 ` Robin Murphy
2024-07-12 15:26 ` Will Deacon
2024-07-02 11:40 ` [PATCH v3 3/5] ACPI: Retire acpi_iommu_fwspec_ops() Robin Murphy
2024-07-02 11:40 ` [PATCH v3 4/5] OF: Simplify of_iommu_configure() Robin Murphy
2024-07-02 11:40 ` [PATCH v3 5/5] iommu: Remove iommu_fwspec ops Robin Murphy
2024-07-04 14:19 ` [PATCH v3 0/5] " Will Deacon
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=7d6ebec135483f889af00eb376aa31c012efc3b2.1719919669.git.robin.murphy@arm.com \
--to=robin.murphy@arm.com \
--cc=andy.shevchenko@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=guohanjun@huawei.com \
--cc=iommu@lists.linux.dev \
--cc=jean-philippe@linaro.org \
--cc=joro@8bytes.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=lpieralisi@kernel.org \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
--cc=sudeep.holla@arm.com \
--cc=will@kernel.org \
--cc=yong.wu@mediatek.com \
/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
all inboxes | Powered by JetHome®