From patchwork Wed Jun 8 07:18:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 9163491 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C0C9460832 for ; Wed, 8 Jun 2016 07:28:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B12A428376 for ; Wed, 8 Jun 2016 07:28:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5DBF28393; Wed, 8 Jun 2016 07:28:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E1D728376 for ; Wed, 8 Jun 2016 07:28:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932966AbcFHH2g (ORCPT ); Wed, 8 Jun 2016 03:28:36 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36378 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932881AbcFHH2f (ORCPT ); Wed, 8 Jun 2016 03:28:35 -0400 Received: by mail-pf0-f195.google.com with SMTP id 62so22427921pfd.3; Wed, 08 Jun 2016 00:28:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=d9Nwy26LaScp6OFagsJp/njJxh88R+86dhLrU4qcWFU=; b=PYGBZdmXWns5UH5Nx6SOzMEsrY49gEmw6X2BbjpWXFHUDjOiCf5F2hCKLz8nPoJn0Y 2s5MEKim+/JtockRqNVhzE292AecsSEijcJ3b8zEidHW4QK6CDWS0S49l29dtqyK882B WV8NEtJO1Ft59jyYCHEWuzpI7ja8adIboque//FRsBSce7l6JgkbxW5FJxu96jOdjflD xW0AWg27VuVDYyNJSx+8sCv3fS9zWxS5WCtCPAZhXW7LTI3gJZgZFjZexYetqw0rTU9g 6NrFeRKOS0ceinzmrOvlVO1/+zWYnlG7rsHkfPRCb69/V/yBDZHNziepVlqWirgPG9Mf WTEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:date:message-id:in-reply-to :references:subject; bh=d9Nwy26LaScp6OFagsJp/njJxh88R+86dhLrU4qcWFU=; b=F/LWbaplixcfHZRmM0ihP8/9YRS2T/GIVnTYn3ZoW4crdZrnIHtdWXfoY01freDOyr YF1aIddfIQkChpzgxsrVMuiqEW2s5rIqXyv3MIqx3sJM4M6KU2hcPnlCAkJhAGLnmaVN 1iJZPIP3h8WFudyRdzieoPZjRbdSwMx8fEuXG7C2fmunCDONyOHe4hJQdEf6x+qhyld0 TuCp8tFznaq/FqrN9+RufbLljhH7eIV9IjgeR7NTALSvF/NmSpeLlJoFdyUbf0xsSErj UEdFlpm+B+rZysOMOFMbgnKyHqi4DHVYuTW5oY4lNO9tA/z8T1+Lzpl35Cxs8X4+D5NQ 1m6A== X-Gm-Message-State: ALyK8tLB/vq2TGENdeXcMSojHXkuoD3/JZWX/21h8wAfLO10BpDo860dcSkrsAAWXgWNLQ== X-Received: by 10.98.69.197 with SMTP id n66mr4268899pfi.75.1465370914374; Wed, 08 Jun 2016 00:28:34 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by smtp.gmail.com with ESMTPSA id b66sm11395185pfb.55.2016.06.08.00.28.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jun 2016 00:28:33 -0700 (PDT) From: Magnus Damm To: iommu@lists.linux-foundation.org Cc: laurent.pinchart+renesas@ideasonboard.com, geert+renesas@glider.be, joro@8bytes.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, horms+renesas@verge.net.au, Magnus Damm , robin.murphy@arm.com, m.szyprowski@samsung.com Date: Wed, 08 Jun 2016 16:18:15 +0900 Message-Id: <20160608071815.7560.8738.sendpatchset@little-apple> In-Reply-To: <20160608071737.7560.32571.sendpatchset@little-apple> References: <20160608071737.7560.32571.sendpatchset@little-apple> Subject: [PATCH v4 04/07] iommu/ipmmu-vmsa: Break out domain allocation code Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Break out the domain allocation code into a separate function. This is preparation for future code sharing. Signed-off-by: Magnus Damm --- Changes since V3: - None Changes since V2: - Included this new patch as-is from the following series: [PATCH 00/04] iommu/ipmmu-vmsa: IPMMU CONFIG_IOMMU_DMA update drivers/iommu/ipmmu-vmsa.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) --- 0005/drivers/iommu/ipmmu-vmsa.c +++ work/drivers/iommu/ipmmu-vmsa.c 2016-06-08 15:00:20.760607110 +0900 @@ -507,13 +507,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; @@ -523,6 +520,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);