Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp304261ybe; Mon, 2 Sep 2019 01:45:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOl1GagdmECtZIYVoECjJ53O5+8UeFRUFQOJhC5TZxbSQFJdtuXZ2YYQwy7i4yRdrwSX3t X-Received: by 2002:a62:2d3:: with SMTP id 202mr19779234pfc.141.1567413929762; Mon, 02 Sep 2019 01:45:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567413929; cv=none; d=google.com; s=arc-20160816; b=NL9GzlmiLNoE1g8euAMNXM92XovwoFopqLdo/p0+Cr44B16KHt61Y1OjXfPb53OBEm ag7J0E64FJaqJhEFNDPSuHez97w5L0nLq5LH3surV6b7t+iW3ASSysMCrVHRqyn57And pnpVq+dI8WO+Kvj7AJ6Z8CK+829tbzH2lnDG3vNYN0lK6Gxc78YkkWzTrY638mqRs6ZS SMK/03T0E+Dnja+UO+1dQowK8YqW4mOEMXL+6CBKrhjLbUexNQDxrjR8xWAh/8iugs24 rZGV/t2gBg0cNCfg+wjw3FSugbAGeZxaIVnH8LV8uv4ceDp0qcaUhlh6NbUAzWJ+OVW2 Dh6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=uFmY0zGFn+EQnA57VOg3VeO9qiRTqjJoOe1gdV98IwA=; b=x8O40/P4PSNFdTyj4tat2/ZGQjITtJv7XtBuzTYUdiPbYs2Gr476NbuFoPAlHYLazM T7RbNXTTIy9Q5pxZM2EWw0sQNO3cbJ5Qdzxk5p4SQ9oZwQJqxX1DZg0aluryJzm/quLf uZKYjzPw7R//0JBd1sTb6mLIK25koTFL/jyr2cLSxhuQezYuf2feaXVCcntVBEF8sHia ULnlHPnZTchjUw7HCybBXVaYesdXM4BACpzTf+90/ezs9SM67Nquo0b557pIY7K1l1o7 to5lq6INZBd7N3KtoA81bJd+dT4IbCe7SodXvUdBQGbVyg1Hl/nX7IFzTV4YPpfNAiDV krSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cYu84DUj; 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 d6si10996255pgh.35.2019.09.02.01.45.13; Mon, 02 Sep 2019 01:45:29 -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=cYu84DUj; 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 S1730311AbfIBIe4 (ORCPT + 99 others); Mon, 2 Sep 2019 04:34:56 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34477 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729602AbfIBIez (ORCPT ); Mon, 2 Sep 2019 04:34:55 -0400 Received: by mail-pg1-f193.google.com with SMTP id n9so7145227pgc.1 for ; Mon, 02 Sep 2019 01:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=uFmY0zGFn+EQnA57VOg3VeO9qiRTqjJoOe1gdV98IwA=; b=cYu84DUjPTKSgEfeLZtea5ZEO+oEaJLALl1KB7muOH5m/fFs57yP+LCBWA6ArhPio2 WkWh2wrJ47bV5YbLwT4iwCqb0Ai/rODNnzr2DLp/L4oyyVLmYnl8diGTiWZcLmPts4RT Fvycb5VDcIqhCDQUwOkf5B/KrPFRGEDMpFQ0ye36mXAuIE2ktSav4aoIKXNO5UKgjCs9 XeRU/NPTPSKO6SIsAXPP6l9CAopbF2aMh6wQABGv4Bll8xPxRW8O0MHHWhR31XaYpl8N rSDNcLd/VdJKmITmEkdXcJB0iI2uADXabuFqj6oUAtUumdu4JVui5i97iRe4w4fSGhL9 VORQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=uFmY0zGFn+EQnA57VOg3VeO9qiRTqjJoOe1gdV98IwA=; b=Wb1oMuwOUaojbCGhCkokGzPqaDtdrE/wHiwtR4O0IB6wrnz/CyvwTjt8ua48dyE2+V DE+BJFGtNmTaHzaB/F9RhHpEXHuyjvlie++f81x6tcD5nt+LtEPBzIpQtNFEphzUPy4y HadX+Y/Ws0zoukU7UcaIVwNBa4Dgv5B0s6/7VuXDfmKqCVIzFTZhMX4d1jbK2MIbaPGB SNmT8XYWVJkALdL3QVwsV8mpBgmA1vb6XFaEKxlxD5GOAeGZk7WxnjxsCDnTfL1Y9n0m Xpp5CxlnBEHolGlRLx5dRfRiudUG5v/qXwqRINNPa7GhhcwqpdzOJ+6RWsskYzuhR69+ TSbA== X-Gm-Message-State: APjAAAU5kh67rT4WpYGjEaYYT7JR5PvK4DBPM2Hr6GLrlf5m3rw0BDz0 dQ5xKmsa6m4UAuKa5s78ENw= X-Received: by 2002:a63:184b:: with SMTP id 11mr25468636pgy.112.1567413294974; Mon, 02 Sep 2019 01:34:54 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC.domain.name ([49.207.50.39]) by smtp.gmail.com with ESMTPSA id g9sm6977813pjl.0.2019.09.02.01.34.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Sep 2019 01:34:53 -0700 (PDT) From: Souptick Joarder To: konrad.wilk@oracle.com, boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org Cc: xen-devel@lists.xenproject.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, sabyasachi.linux@gmail.com, Souptick Joarder Subject: [PATCH v2] swiotlb-xen: Convert to use macro Date: Mon, 2 Sep 2019 14:09:58 +0530 Message-Id: <1567413598-4477-1-git-send-email-jrdr.linux@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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