Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1593892

[PATCH v7 04/07] iommu/ipmmu-vmsa: Break out domain allocation code

From Magnus Damm <magnus.damm@gmail.com>
Newsgroups linux.kernel
Subject [PATCH v7 04/07] iommu/ipmmu-vmsa: Break out domain allocation code
Date 2017-03-07 04:50 +0100
Message-ID <tieil-1rh-7@gated-at.bofh.it> (permalink)
References <tie8G-1nN-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Magnus Damm <damm+renesas@opensource.se>

Break out the domain allocation code into a separate function.
This is preparation for future code sharing.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Reviewed-by: Joerg Roedel <jroedel@suse.de>
---

 Changes since V6:
 - None

 drivers/iommu/ipmmu-vmsa.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

--- 0006/drivers/iommu/ipmmu-vmsa.c
+++ work/drivers/iommu/ipmmu-vmsa.c	2017-03-06 18:34:59.520607110 +0900
@@ -509,13 +509,10 @@ static irqreturn_t ipmmu_irq(int irq, vo
  * IOMMU Operations
  */
 
-static struct iommu_domain *ipmmu_domain_alloc(unsigned type)
+static struct iommu_domain *__ipmmu_domain_alloc(unsigned type)
 {
 	struct ipmmu_vmsa_domain *domain;
 
-	if (type != IOMMU_DOMAIN_UNMANAGED)
-		return NULL;
-
 	domain = kzalloc(sizeof(*domain), GFP_KERNEL);
 	if (!domain)
 		return NULL;
@@ -525,6 +522,14 @@ static struct iommu_domain *ipmmu_domain
 	return &domain->io_domain;
 }
 
+static struct iommu_domain *ipmmu_domain_alloc(unsigned type)
+{
+	if (type != IOMMU_DOMAIN_UNMANAGED)
+		return NULL;
+
+	return __ipmmu_domain_alloc(type);
+}
+
 static void ipmmu_domain_free(struct iommu_domain *io_domain)
 {
 	struct ipmmu_vmsa_domain *domain = to_vmsa_domain(io_domain);

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v7 00/07] iommu/ipmmu-vmsa: IPMMU multi-arch update V7 Magnus Damm <magnus.damm@gmail.com> - 2017-03-07 04:40 +0100
  [PATCH v7 01/07] iommu/ipmmu-vmsa: Remove platform data handling Magnus Damm <magnus.damm@gmail.com> - 2017-03-07 04:40 +0100
    Re: [PATCH v7 01/07] iommu/ipmmu-vmsa: Remove platform data handling Geert Uytterhoeven <geert@linux-m68k.org> - 2017-03-08 14:10 +0100
  [PATCH v7 05/07] iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops Magnus Damm <magnus.damm@gmail.com> - 2017-03-07 04:40 +0100
    Re: [PATCH v7 05/07] iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops Robin Murphy <robin.murphy@arm.com> - 2017-03-08 14:40 +0100
  [PATCH v7 02/07] iommu/ipmmu-vmsa: Rework interrupt code and use bitmap for context Magnus Damm <magnus.damm@gmail.com> - 2017-03-07 04:40 +0100
  [PATCH v7 03/07] iommu/ipmmu-vmsa: Break out utlb parsing code Magnus Damm <magnus.damm@gmail.com> - 2017-03-07 04:40 +0100
  [PATCH v7 07/07] iommu/ipmmu-vmsa: Drop LPAE Kconfig dependency Magnus Damm <magnus.damm@gmail.com> - 2017-03-07 04:40 +0100
  [PATCH v7 04/07] iommu/ipmmu-vmsa: Break out domain allocation code Magnus Damm <magnus.damm@gmail.com> - 2017-03-07 04:50 +0100
    Re: [PATCH v7 04/07] iommu/ipmmu-vmsa: Break out domain allocation code Geert Uytterhoeven <geert@linux-m68k.org> - 2017-03-08 11:00 +0100

csiph-web