From patchwork Wed May 23 06:02:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 136622 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp481042lji; Tue, 22 May 2018 23:03:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqzUA54ehPF5ApI7y4XRSWbKUMB594g5bmn6ZOqcB88r7l7/Umw7VCVx27XKsgBDiJ//+UE X-Received: by 2002:a63:4281:: with SMTP id p123-v6mr215326pga.144.1527055415113; Tue, 22 May 2018 23:03:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527055415; cv=none; d=google.com; s=arc-20160816; b=hY7OROdJ/ZUMuQO++LamF/8Bi0rKuhpC+2u7Hu1oPTzHDY/ohHNNX7wcI7MAnqMEeR seSW18XK/ZIVH3BiQWbwNNIFb98VdRnlhV9WwWui+8tiixxk7k/u86/UbcDG3kXM3rSE HaOoNxR1GAjQcA/d/uVugDQ+T/W/Y1FqiMecW6cB8TUfkUQMu7KCuMf4Ex1twhqiHP7a uXL92EnudkqvCVpzqQh+kQgu7OYElj1mzVpEeXx6DjeRALLIIcQajDpSIcPWv6WHiu4O vkv9r+77rxrSTVchP6NFvgj6ddZEKbPB12/oCgACoG8jB4T2pRs8ayOLinU2qS98xXsI 7NRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:to :from:arc-authentication-results; bh=yQDxZzTIjFTT7hky6DAQwiEF4L89TxT0F5dNQJXHI/4=; b=RKtmdbFlxqq2Y+r6kiSersOpJmSytemzCzNkbOUenex7lLnBOXSQ/rgkiVz+gHp9v6 OugjNaErnr+aFFKUiVEnKnuHoDcKW6iBJNoQ/9HdKTaXaZvd4yfc3thvIDVDntARvgcm 2W2rRFZI+3tfw9Mg9UEj0Lhb5gVo/O9Afjo2EIooYs6lhy9Vaffur1S1nMIdWu1uXQej 6d3/5cLb3sAIRWyVyRfDkF609kSuBKR//O8JfvC9WFfJDr7tqi7G3M8gWeEn+LAd1U1s 0HlEx7dlFNi+OdRcO34bPaFCyAMlFCi+3dL+7QHyw+o8RLE14GFjj+ukyefIjRYEY5dZ romw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t71-v6si14432969pgd.7.2018.05.22.23.03.34; Tue, 22 May 2018 23:03:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753986AbeEWGDc (ORCPT + 30 others); Wed, 23 May 2018 02:03:32 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8129 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753826AbeEWGDb (ORCPT ); Wed, 23 May 2018 02:03:31 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 755766C445FAC; Wed, 23 May 2018 14:03:17 +0800 (CST) Received: from localhost (10.177.23.164) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.382.0; Wed, 23 May 2018 14:03:15 +0800 From: Zhen Lei To: Joerg Roedel , iommu , Robin Murphy , linux-kernel Subject: [PATCH 1/1] iommu/dma: fix trival coding style mistake Date: Wed, 23 May 2018 14:02:49 +0800 Message-ID: <1527055369-13192-1-git-send-email-thunder.leizhen@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.0 MIME-Version: 1.0 X-Originating-IP: [10.177.23.164] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No functional changes. Signed-off-by: Zhen Lei --- drivers/iommu/dma-iommu.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) -- 1.8.3 diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index ddcbbdb..4e885f7 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -231,6 +231,9 @@ static int iova_reserve_iommu_regions(struct device *dev, LIST_HEAD(resv_regions); int ret = 0; + if (!dev) + return 0; + if (dev_is_pci(dev)) iova_reserve_pci_windows(to_pci_dev(dev), iovad); @@ -246,11 +249,12 @@ static int iova_reserve_iommu_regions(struct device *dev, hi = iova_pfn(iovad, region->start + region->length - 1); reserve_iova(iovad, lo, hi); - if (region->type == IOMMU_RESV_MSI) + if (region->type == IOMMU_RESV_MSI) { ret = cookie_init_hw_msi_region(cookie, region->start, region->start + region->length); - if (ret) - break; + if (ret) + break; + } } iommu_put_resv_regions(dev, &resv_regions); @@ -308,8 +312,6 @@ int iommu_dma_init_domain(struct iommu_domain *domain, dma_addr_t base, } init_iova_domain(iovad, 1UL << order, base_pfn); - if (!dev) - return 0; return iova_reserve_iommu_regions(dev, domain); }