Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp868319ybe; Fri, 6 Sep 2019 08:28:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgHy3S4cwXko+qBXZZvT/FuAA+rU6hn53b2AGGgsuUyQ8hCmuCfQbeWCYMf+saFYAPzxxR X-Received: by 2002:a17:90a:8d0c:: with SMTP id c12mr10347487pjo.119.1567783699455; Fri, 06 Sep 2019 08:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567783699; cv=none; d=google.com; s=arc-20160816; b=feJU32dy4+qPerBQfg8fnN3GvXXecLyhTUsAXbQGD+Vq1MzwTkLEB+VvfUCtlUynDM nH6bA/HwcPDHyf0Gze7lVL53AsxY/zGFVFZEIZPVOWnkmVikSPG12YwHg+B9uHVgxcPV eMLxFeusZs0QgRs7OvBrABSy9dqXJ7znvvUakvghDEKVLCq9QPof6HLIOjDaXVs9JRV2 B6SjPdEvTvzbUsJf8ruMkQagArgg0vfXHNHBooQHI1LZ7n9g8BPGT5j4UZmtubSlvpuA xEWCkYaHZ1YGsvzrTjfw+QzoKLP2f49VareXrjLStMag+KjWArtSD4ioPQ1J1eazl0qq u+GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=voMncQMQ4YdYJSbQPybIZCy/AcK0j9pgJUBzJv0XJ0A=; b=xRkE4RHbqBYxqVp3zGdmfOyOR1X1Fzc8DHupsOH2u79aXvoM2GB7v2fsxM/Fv4YWMu wFge5Ffsq+LAo1rpQL1e6VUOpV2DUI35priIMl7QVRnfdUrsxavlFShhvKshtwlHn6Pp nzZG24RABxo37OIfrJ8rGbaAI/ie+fNrMzcbNNXysN/4MeCgJgRNcFKHPFO/SSzI5uEP vh35x5tOYDJD4RPhIif+OsrSZiIcavXoaBi4eUR026N9qhcOHAHcUq4Ew+jsRdzeNAlI u2BslH0Xr1yU/H2DoV9B9V8g8slbWiRSt8SQUhFmGX7ODsf0CjzxbhkO+uIsSOluem/2 D/sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sqTvZMOg; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si5218681plz.338.2019.09.06.08.28.03; Fri, 06 Sep 2019 08:28:19 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sqTvZMOg; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404387AbfIFM1c (ORCPT + 99 others); Fri, 6 Sep 2019 08:27:32 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:40652 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403993AbfIFM1c (ORCPT ); Fri, 6 Sep 2019 08:27:32 -0400 Received: by mail-lj1-f195.google.com with SMTP id 7so5804804ljw.7 for ; Fri, 06 Sep 2019 05:27:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=voMncQMQ4YdYJSbQPybIZCy/AcK0j9pgJUBzJv0XJ0A=; b=sqTvZMOg0FK+tbQ5Twd8lIUIdl5cRw7f3mUvyMcKovHkLwtCNr+KhR8ryq4wVIDwmE MrBFX2gvgSY3HU2O7p/fa3kIFtwabChkkv1UJeIL2HzkjG5QPDhFYHq8EkK3B24Bgydv Fi2qkSQYUx9TdJxWg4stgkl9/pi/wDuDnFFyyRBx/kMYn9jJS/zdvJSGTuo1h2Temozf Nvf/Hnfjf2PuJ6a6jToQHWZwxuQcOEfdbQhKzPmea0lJsU/ZNqvBUb+imGx19W9r0HCK Hyvu0+zXQQzELhka7MTfPB6km6DSDMOt5IvIpqPyjyiI/acvmccpl7me4YJqAOCRVfA5 PFBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=voMncQMQ4YdYJSbQPybIZCy/AcK0j9pgJUBzJv0XJ0A=; b=fdyinHi4RT1h+axEEgCnHjUM8u0ggEZctV89BXyqKth1uwPxoHib5HwUl5Z8Ccj3Zb 4rbaZGngK83HSJNKdtnf4n8oGaY93qpB+aZQKtYCiOS4OsZ6E/9uZrtCd6Z2V+zglBMC 7s7K2m/09wmntEfGkhvzAC79DpQqrUsABpzfHcDsqZJUHlS4facrZXQn6BnlHFx0KezW X28WaJCcLaa9rrgXYS/3SCQKAzhJbp7as+wkAD3jy0Ab650yIBArBrodvoVaFWjMdXak zQHrWn0VJ4RXo6jrtAXdgciYLHcJ9Awv4+a0EtBbMLnvjWkRl8CJlgXCYTPB3l990OKx tFNw== X-Gm-Message-State: APjAAAVWDw9DbeVW4LiVrqNiHbmqgc+McTusq/3onzgkKjRQC+XI+9Rs 1Cb1fivz84Yy5rYrznbI+4q2Q34Hf6YaOzxyUac= X-Received: by 2002:a2e:9602:: with SMTP id v2mr5657222ljh.215.1567772850472; Fri, 06 Sep 2019 05:27:30 -0700 (PDT) MIME-Version: 1.0 References: <1567413598-4477-1-git-send-email-jrdr.linux@gmail.com> In-Reply-To: <1567413598-4477-1-git-send-email-jrdr.linux@gmail.com> From: Souptick Joarder Date: Fri, 6 Sep 2019 17:57:19 +0530 Message-ID: Subject: Re: [PATCH v2] swiotlb-xen: Convert to use macro To: konrad.wilk@oracle.com, Boris Ostrovsky , Juergen Gross , sstabellini@kernel.org Cc: xen-devel@lists.xenproject.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Sabyasachi Gupta Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 2, 2019 at 2:04 PM Souptick Joarder wrote: > > Rather than using static int max_dma_bits, this > can be coverted to use as macro. > > Signed-off-by: Souptick Joarder > Reviewed-by: Juergen Gross If it is still not late, can we get this patch in queue for 5.4 ? > --- > drivers/xen/swiotlb-xen.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c > index ae1df49..d1eced5 100644 > --- a/drivers/xen/swiotlb-xen.c > +++ b/drivers/xen/swiotlb-xen.c > @@ -38,6 +38,7 @@ > #include > > #include > +#define MAX_DMA_BITS 32 > /* > * Used to do a quick range check in swiotlb_tbl_unmap_single and > * swiotlb_tbl_sync_single_*, to see if the memory was in fact allocated by this > @@ -114,8 +115,6 @@ static int is_xen_swiotlb_buffer(dma_addr_t dma_addr) > return 0; > } > > -static int max_dma_bits = 32; > - > static int > xen_swiotlb_fixup(void *buf, size_t size, unsigned long nslabs) > { > @@ -135,7 +134,7 @@ static int is_xen_swiotlb_buffer(dma_addr_t dma_addr) > p + (i << IO_TLB_SHIFT), > get_order(slabs << IO_TLB_SHIFT), > dma_bits, &dma_handle); > - } while (rc && dma_bits++ < max_dma_bits); > + } while (rc && dma_bits++ < MAX_DMA_BITS); > if (rc) > return rc; > > -- > 1.9.1 >