Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp13575pxv; Wed, 21 Jul 2021 14:06:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzR5gav1EwhTDQTIIBNAlaTR8/3V+yUqZwAdAoID/IwnRGYudN2ZOkBW2SH7zjyC8J0uQSh X-Received: by 2002:a05:6e02:1142:: with SMTP id o2mr26227766ill.277.1626901526952; Wed, 21 Jul 2021 14:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626901526; cv=none; d=google.com; s=arc-20160816; b=H79dsayi5RFscH+8U3stnz+RvvuSSGzrOsp8Ly73NYswR4kFDpyVf6wBbKt0O3YOVX g6o/eW6tJbogJ+oVNQCGL8cRTCJn9CSbzIZ8p4c5bc6CJENeIhXHEofX5Ms3CgZ/sUvn Xx/YfEQuG4whHi8j7/E8BhA2EM3oa7dN9S8E99qAQObddpirQ589JSlrLf+9goZZBw6Z Rk0UxZ5Qi3iH3HJ2MH4T3gNnfCpsDJiVGSf+iqOLURqLVf+RR0j+/of1yKfPcg3/hH4h eKBJ0L93TnSm6n0qVLF4cjeCM8NhHt5hPJBlOYI7kCWIn81tino6xGrA+FXLFnfpLFrN pYbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=0oPsByF/qPUVxUAyzJtDqOyzlbGhE2I5ahSWEthT/Cw=; b=UjtiS+TKflOnHMvGqb7EP1amCvKFZ6qAMFttlPGKjGP+aGpo+8ulykXcqm3ZKQaayc Yxzenh3JPsgBigRYus/Pt20uia5iGDGjjRyaxr6gm/kL9zY+rhrTYAk5eFAQl2VocsPi 0SVJ2QubDbaVeeUFg3+b89JHxLnS+V7miOQmhS4XyXgCDcgxBZEI8wObXV8C4KyOu41p /5Ui4Yde1Vki9sjwDzC+A+HfSZyShybrqfDeG2MjnWeNY3IPmEBl8iko6cFDFf7Firn/ GKeR2gTevJEighnpU2zMkLIfWt2CXFtJHy7ug5O/Qa2Oh2obs5b6dnMKeWEO0qaJuK2B liPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r3si5716183jan.7.2021.07.21.14.05.14; Wed, 21 Jul 2021 14:05:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238390AbhGURk4 (ORCPT + 99 others); Wed, 21 Jul 2021 13:40:56 -0400 Received: from foss.arm.com ([217.140.110.172]:33352 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236533AbhGURkc (ORCPT ); Wed, 21 Jul 2021 13:40:32 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0EF7D139F; Wed, 21 Jul 2021 11:21:08 -0700 (PDT) Received: from 010265703453.arm.com (unknown [10.57.36.146]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8845E3F694; Wed, 21 Jul 2021 11:21:06 -0700 (PDT) From: Robin Murphy To: joro@8bytes.org, will@kernel.org Cc: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, suravee.suthikulpanit@amd.com, baolu.lu@linux.intel.com, john.garry@huawei.com, dianders@chromium.org Subject: [PATCH 13/23] iommu/dma: Remove redundant "!dev" checks Date: Wed, 21 Jul 2021 19:20:24 +0100 Message-Id: <4395626d7a4ba84ecce4ff8bc6d086795cebf0a6.1626888445.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org iommu_dma_init_domain() is now only called from iommu_setup_dma_ops(), which has already assumed dev to be non-NULL. Signed-off-by: Robin Murphy --- drivers/iommu/dma-iommu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 10067fbc4309..e28396cea6eb 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -363,7 +363,7 @@ static int iommu_dma_init_domain(struct iommu_domain *domain, dma_addr_t base, init_iova_domain(iovad, 1UL << order, base_pfn); - if (!cookie->fq_domain && (!dev || !dev_is_untrusted(dev)) && + if (!cookie->fq_domain && !dev_is_untrusted(dev) && domain->ops->flush_iotlb_all && !iommu_get_dma_strict(domain)) { if (init_iova_flush_queue(iovad, iommu_dma_flush_iotlb_all, iommu_dma_entry_dtor)) @@ -372,9 +372,6 @@ static int iommu_dma_init_domain(struct iommu_domain *domain, dma_addr_t base, cookie->fq_domain = domain; } - if (!dev) - return 0; - return iova_reserve_iommu_regions(dev, domain); } -- 2.25.1