From: cn_wyl2003@126.com
To: joro@8bytes.org, will.deacon@arm.com, alex.williamson@redhat.com,
renesas@opensource.se, yalin.wang2010@gmail.com,
nicolas.iooss_linux@m4x.org, robin.murphy@arm.com,
iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: [PATCH] iommu: change generic_device_group function
Date: Fri, 25 Mar 2016 20:06:51 +0800 [thread overview]
Message-ID: <1458907611-19694-1-git-send-email-cn_wyl2003@126.com> (raw)
From: yalin wang <yalin.wang2010@gmail.com>
change this function to return only iommu_group* pointer or
PTR_ERR(), never return NULL when failed.
The caller of this function only check IS_ERR() for its return value.
Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
---
drivers/iommu/iommu.c | 15 ---------------
include/linux/iommu.h | 10 ++++++++--
2 files changed, 8 insertions(+), 17 deletions(-)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index bfd4f7c..4984108 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -728,21 +728,6 @@ static int get_pci_alias_or_group(struct pci_dev *pdev, u16 alias, void *opaque)
}
/*
- * Generic device_group call-back function. It just allocates one
- * iommu-group per device.
- */
-struct iommu_group *generic_device_group(struct device *dev)
-{
- struct iommu_group *group;
-
- group = iommu_group_alloc();
- if (IS_ERR(group))
- return NULL;
-
- return group;
-}
-
-/*
* Use standard PCI bus topology, isolation features, and DMA alias quirks
* to find or create an IOMMU group for a device.
*/
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index a5c539f..462280b 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -327,8 +327,14 @@ static inline size_t iommu_map_sg(struct iommu_domain *domain,
/* PCI device grouping function */
extern struct iommu_group *pci_device_group(struct device *dev);
-/* Generic device grouping function */
-extern struct iommu_group *generic_device_group(struct device *dev);
+/*
+ * Generic device_group call-back function. It just allocates one
+ * iommu-group per device.
+ */
+static inline struct iommu_group *generic_device_group(struct device *dev)
+{
+ return iommu_group_alloc();
+}
#else /* CONFIG_IOMMU_API */
--
1.9.1
next reply other threads:[~2016-03-25 12:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-25 12:06 cn_wyl2003 [this message]
2016-04-05 15:04 ` Joerg Roedel
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=1458907611-19694-1-git-send-email-cn_wyl2003@126.com \
--to=cn_wyl2003@126.com \
--cc=alex.williamson@redhat.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.iooss_linux@m4x.org \
--cc=renesas@opensource.se \
--cc=robin.murphy@arm.com \
--cc=will.deacon@arm.com \
--cc=yalin.wang2010@gmail.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®