Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp608916ybi; Tue, 16 Jul 2019 02:34:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqws1vzUK2VqpjnKsmo4ALxBLpepsLXkqcebeKnhRLB6hzPs0OyEfdwhXEnBzA0dsp9INFu3 X-Received: by 2002:a63:ef4b:: with SMTP id c11mr30103241pgk.129.1563269655274; Tue, 16 Jul 2019 02:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563269655; cv=none; d=google.com; s=arc-20160816; b=BkVN4+M7+Sdri1I0RqqEcvkQE5hQfG98gtdIiwhjQiZ5t0V1ECEXzpcpIrFxuw9MIa c+uqh4cbYL7l4/c8EilxMVHUZ0uBzOL5uUTg8joUKoWkUc6pGosJ8YNpwUh1G3PkVNSc 3UJuJLlhRp0d0QVfpX0QLAoS9eri0/4RLjgTT1Ur29jNAg8p56iQ8OIKLK3lKgY8u/eN HsGjGacfrfNh128FFugHD/O4+HePhiMIOQ0xKA0BRvmNoQBhIsbN9u+kK3JaGVjrw0XW DMFEiKF2rlsu2y4aWZhwjQca3NQRuTJJuVhcmwI4DCb/NEkUkGdKdfzqdj0znaordkX9 afjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=In2hzYajHh+BhPcTY8H9S81v5wz+JpRJD8DzuVru7U8=; b=rppMXJ0jfzjFzC38IwSekMVG+vhwY32W5hXWh2398MpqkjqQFAR1gkOoxD4KmWByUA yS93ord26abilbYew22EILonY2u1onJcVM+QJ4hNizgo40u5LqsZ7+kq3CzHkSnZeIUu VwrPIU9PNoNBp0L2nbAzatMlZQ/qHDi55HEaYApz00NESMfkjPhg5wqd26H3HLMiUC/8 roJwDDhXYLzo+capudvnDf751TWu695TcVB9wld4L0lUF/7PmUdBrDF1ts8qmCd4Y+EJ gCBghXzLei4OPuDxYy3sektCvmgmXVjFaK4zERwHHryO7LITxz469nnxvfhHLxr/B0iK FiOA== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7si18816174pjo.88.2019.07.16.02.33.59; Tue, 16 Jul 2019 02:34:15 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731849AbfGPJdX (ORCPT + 99 others); Tue, 16 Jul 2019 05:33:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33732 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726997AbfGPJdX (ORCPT ); Tue, 16 Jul 2019 05:33:23 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DAFA081F18; Tue, 16 Jul 2019 09:33:22 +0000 (UTC) Received: from [10.36.116.32] (ovpn-116-32.ams2.redhat.com [10.36.116.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BCC645C21A; Tue, 16 Jul 2019 09:33:17 +0000 (UTC) Subject: Re: [PATCH v4 16/22] iommu/vt-d: Move domain helper to header To: Jacob Pan , iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , Alex Williamson , Jean-Philippe Brucker Cc: Yi Liu , "Tian, Kevin" , Raj Ashok , Christoph Hellwig , Lu Baolu , Andriy Shevchenko References: <1560087862-57608-1-git-send-email-jacob.jun.pan@linux.intel.com> <1560087862-57608-17-git-send-email-jacob.jun.pan@linux.intel.com> From: Auger Eric Message-ID: <6c983a69-076b-da70-e41e-5f4dd6750cd0@redhat.com> Date: Tue, 16 Jul 2019 11:33:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1560087862-57608-17-git-send-email-jacob.jun.pan@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 16 Jul 2019 09:33:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jacob, On 6/9/19 3:44 PM, Jacob Pan wrote: > Move domainer helper to header to be used by SVA code. > > Signed-off-by: Jacob Pan > --- > drivers/iommu/intel-iommu.c | 6 ------ > include/linux/intel-iommu.h | 6 ++++++ > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c > index 39b63fe..7cfa0eb 100644 > --- a/drivers/iommu/intel-iommu.c > +++ b/drivers/iommu/intel-iommu.c > @@ -427,12 +427,6 @@ static void init_translation_status(struct intel_iommu *iommu) > iommu->flags |= VTD_FLAG_TRANS_PRE_ENABLED; > } > > -/* Convert generic 'struct iommu_domain to private struct dmar_domain */ > -static struct dmar_domain *to_dmar_domain(struct iommu_domain *dom) > -{ > - return container_of(dom, struct dmar_domain, domain); > -} > - > static int __init intel_iommu_setup(char *str) > { > if (!str) > diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h > index 8605c74..b75f17d 100644 > --- a/include/linux/intel-iommu.h > +++ b/include/linux/intel-iommu.h > @@ -597,6 +597,12 @@ static inline void __iommu_flush_cache( > clflush_cache_range(addr, size); > } > > +/* Convert generic 'struct iommu_domain to private struct dmar_domain */ fix the single '? > +static inline struct dmar_domain *to_dmar_domain(struct iommu_domain *dom) > +{ > + return container_of(dom, struct dmar_domain, domain); > +} > + > /* > * 0: readable > * 1: writable > Reviewed-by: Eric Auger Thanks Eric