Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3174417ybd; Mon, 24 Jun 2019 20:59:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqy23tTzeTBjuk0HlIUR4KxyshtTZco0p+l94cmnp/jr8gzAv/wNwcoZvEjM0nchONk2p9Cw X-Received: by 2002:a17:902:fa2:: with SMTP id 31mr128916209plz.38.1561435189993; Mon, 24 Jun 2019 20:59:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561435189; cv=none; d=google.com; s=arc-20160816; b=tteDFAlVK2djksm09eCqcbdFXlbchKVYnjHHTBgvyYVE/GlCEevPV4qVcT+OAqDQxs 9CHDVe45PA24UpNnaJ4Nz3ddIK47qSRUTqnIQ3wrvXezWIM2kiK/5H0SwJFXroTI6o0e 6Dsq5kSLYrm7dSozmejriLTugs+FkSN34vaoo2n1Z61rn5ZB35SEO0bBvhGZrl3gCMq3 dzgGoL2U5vJgSkN8a5a7B7OVgZV8DBv+QRZLsqTHUgxcmEPv/xyZbYLgjjCrKreAZFYK 9NnLbm6Br7c2ZQdgk/shdnBWX+dIl3rbGCBtq9ybX5AsYWpC3tOk69cxEFais2UyMPlW uKvg== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=AQ77rhKZp8NDB+PnS9Hq9tbC18QvwlnWdkDACkAm4iA=; b=frWClpzPQpurIIWAcD9tMN54Ss+RheAK9K8xrHfYdR0JD8BFdJlQYlrl5gUdvmoRrH xbpDU76WM2qF1aClby+lBmO4v9d17LqhLb/QFBfTwtRJwEvMq7PgQBXYLWhInd/BPFiL 4VP6RQg5p8TUkekn5nFCoZSeBC6ilLjtamMuALITfIwyW0GdseO0wT0Z16J5/2kwWL7b 0+jvRlsLN0nPYCdGJG9bTRUD5zwbUZ+g98DXMER+RvkuRzXbe/eMrZmy+5mtqp8AdAgS tV0NlFmCF0YZOJmxOQzzA1ezIVdsMeGMeLd9bpbn+DVQSNrBlCZgaQD2pKo2wHPmOqjW dcTA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z25si11811056pgv.418.2019.06.24.20.59.34; Mon, 24 Jun 2019 20:59:49 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728607AbfFXX4h (ORCPT + 99 others); Mon, 24 Jun 2019 19:56:37 -0400 Received: from mga14.intel.com ([192.55.52.115]:57752 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727234AbfFXX4h (ORCPT ); Mon, 24 Jun 2019 19:56:37 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jun 2019 16:56:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,413,1557212400"; d="scan'208";a="336667312" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.199.155]) by orsmga005.jf.intel.com with ESMTP; 24 Jun 2019 16:56:35 -0700 Date: Mon, 24 Jun 2019 16:59:51 -0700 From: Jacob Pan To: Jonathan Cameron Cc: , LKML , Joerg Roedel , David Woodhouse , "Eric Auger" , Alex Williamson , Jean-Philippe Brucker , "Tian, Kevin" , Raj Ashok , Andriy Shevchenko , jacob.jun.pan@linux.intel.com Subject: Re: [PATCH v4 19/22] iommu/vt-d: Clean up for SVM device list Message-ID: <20190624165951.0646b788@jacob-builder> In-Reply-To: <20190618174237.00000556@huawei.com> References: <1560087862-57608-1-git-send-email-jacob.jun.pan@linux.intel.com> <1560087862-57608-20-git-send-email-jacob.jun.pan@linux.intel.com> <20190618174237.00000556@huawei.com> Organization: OTC X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 18 Jun 2019 17:42:37 +0100 Jonathan Cameron wrote: > On Sun, 9 Jun 2019 06:44:19 -0700 > Jacob Pan wrote: > > > Use combined macro for_each_svm_dev() to simplify SVM device > > iteration. > > > > Suggested-by: Andy Shevchenko > > Signed-off-by: Jacob Pan > > Reviewed-by: Eric Auger > > --- > > drivers/iommu/intel-svm.c | 79 > > +++++++++++++++++++++++------------------------ 1 file changed, 39 > > insertions(+), 40 deletions(-) > > > > diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c > > index 9cbcc1f..66d98e1 100644 > > --- a/drivers/iommu/intel-svm.c > > +++ b/drivers/iommu/intel-svm.c > > @@ -225,6 +225,9 @@ static const struct mmu_notifier_ops > > intel_mmuops = { > > static DEFINE_MUTEX(pasid_mutex); > > static LIST_HEAD(global_svm_list); > > +#define for_each_svm_dev() \ > > + list_for_each_entry(sdev, &svm->devs, list) \ > > + if (dev == sdev->dev) \ > > Could we make this macro less opaque and have it take the svm and dev > as arguments? > sounds good, it makes the code more readable.