Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5074550ybv; Mon, 17 Feb 2020 11:42:32 -0800 (PST) X-Google-Smtp-Source: APXvYqwMebhIzMKeXQFJP/DgOAGJdI2t0cTTpL//2X1Zx6kxe1TfX0gS0VSnfPJynpRHh0UovGmO X-Received: by 2002:a9d:6c01:: with SMTP id f1mr12824988otq.133.1581968552061; Mon, 17 Feb 2020 11:42:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581968552; cv=none; d=google.com; s=arc-20160816; b=cosL1oGAfmCLXimE55JW/PG6QxcOaf9QLGvTQLalsd4CfU3XWf0JswbnPh2Etu9NHd k9Rqo/jbmHYbqMTkYr0cr3eVoNfjH2u5x8urys5Km+5xSavnP6iPHcRD7JzZPK3VZ92r 1Oo4UXTQdDjIYKMHb+05o+5DhAqNj0g9ZQJjwB83U3OkpOj/GY550PNxcIlPVYR4p6HP BUg/T8oPBPlhgS39nfIqPGeJVkpRDPLJX3VO4+s43tyFx2d+VU+vhpr2OSJ3CRCyK5mN rT10jAeO/rM4NlReWwT8iFqNQE5N3AM0qWg2HxlduZU88tfXhsNiTM7NkbuS4C/D9Su/ 5cDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=MBkzex32KFKo6Tm7CM5dLXniSBsZp6G9bvaiIk4ZkVQ=; b=uH6eV/Vmj4GYJG9nfO64UYnNjp0BB4g3cjdLX9LLBZBqZb1hrWmosj27h7W4TMLk0U LsvTPimTuWyoOwfiioeK0tyAQdEBLGLizO8JHn6OB1ZtuYMMGr5koJ2cLs7MrJx1SALq iBZvCrg1zuEuaccPcSMR0++JnX29h9rV7JjPNw/Nr2Vk4UXEMQOrYEEJu6lPDyAIEGQH nQfyDhTeJwq2BKn9J9bcSI5YLt+UHMWANX8FpuFgvmSoNDbpXnpiX9TzHiRmZlKOW20D YbORLtq1fP7S+2Idu9vbS429j/uoYlcbj74vMTjFw2AtKAFmZxOWQ7YKzJscCdtLr0VZ jZMg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 7si6430541oiy.68.2020.02.17.11.42.20; Mon, 17 Feb 2020 11:42:32 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729716AbgBQTjO (ORCPT + 99 others); Mon, 17 Feb 2020 14:39:14 -0500 Received: from 8bytes.org ([81.169.241.247]:54540 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729484AbgBQTjK (ORCPT ); Mon, 17 Feb 2020 14:39:10 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id 5C2AD60E; Mon, 17 Feb 2020 20:39:07 +0100 (CET) From: Joerg Roedel To: Lu Baolu , David Woodhouse Cc: Joerg Roedel , jroedel@suse.de, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] iommu/vt-d: Simplify check in identity_mapping() Date: Mon, 17 Feb 2020 20:38:58 +0100 Message-Id: <20200217193858.26990-6-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200217193858.26990-1-joro@8bytes.org> References: <20200217193858.26990-1-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joerg Roedel The function only has one call-site and there it is never called with dummy or deferred devices. Simplify the check in the function to account for that. Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 16e47ca505eb..0b5a0fadbc0c 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -2916,7 +2916,7 @@ static int identity_mapping(struct device *dev) struct device_domain_info *info; info = dev->archdata.iommu; - if (info && info != DUMMY_DEVICE_DOMAIN_INFO && info != DEFER_DEVICE_DOMAIN_INFO) + if (info) return (info->domain == si_domain); return 0; -- 2.17.1