Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3411870ybl; Sun, 1 Sep 2019 12:29:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5a5SQMbBWr91pMIhWUgz/fYslRqmW5cRiYvXc0o4Q2y4SfvBIu1nIOf+5f+sd95C4fcFl X-Received: by 2002:a65:41c2:: with SMTP id b2mr22056360pgq.320.1567366180547; Sun, 01 Sep 2019 12:29:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567366180; cv=none; d=google.com; s=arc-20160816; b=wksR10u+IQwt0EfZP9Sa/JwE58wpf2vupxw39EaRf9P2kS0s8ZcSlV+ghUf5aJ3eRE LshjQPLNxWaWVKeMbqKAmhwSbaA1dmGPGxff73oz8TNMXlRYHn9Q5KADKy4GvFk0pzUw b3uI4x6/FNI9BFd5UOIr22VdGh7JBPyawYO3gPAumPiPBTPfUSoKnZz/tVIuL6oI199m EcFBTe4/eGTz5vmW+iV5dWdRW4/s0JeFFMMuY1xYT6KNFaI2nEkqmrE2/upT2AlYrP3e q6i1N05VAy3gqzvplhyb0McHm6mnbimhyrT9kME2J71szkOJD6qUg/tj3ez8kHCEEqh+ s6AQ== 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=MYmyqV51fBjQuhWN4wRJPBtp4cf5jebojptEpCVLVOk=; b=NGNtB88p+K75twPazQTafK2LRrTCT+kzS/8oEsW1FFxwYdXqYH1wZwGI/IKxiHdMcQ IsMj6WKk6yIoZmyQk7j0+IxG0FIrfTSnca+Ofi1FHm87OUSQY5OGYZrj1yP7fFeRf1wM ic7n41SL8+cRz3LE9fttBU8RCe5982qOdIPkma/GroIhHOLfxoiq/QZvzus/gmGgVm0n Me+EqILBSBopnURkxpw454fpJm141zFMzJ92FPMZg/BXARCJvgR1WvmDGEzs8jqbJ/Uu UJz5PgjYgBU5xuk1ccNrDc5TGNOvqngJhwzaSnSnLoimAUiDlNCFJRnmNpO7jyI5wBVs Ngjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TjHWNZc0; 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 y5si6791938pjp.4.2019.09.01.12.29.13; Sun, 01 Sep 2019 12:29:40 -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=TjHWNZc0; 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 S1729198AbfIATXt (ORCPT + 99 others); Sun, 1 Sep 2019 15:23:49 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:33331 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729142AbfIATXs (ORCPT ); Sun, 1 Sep 2019 15:23:48 -0400 Received: by mail-pl1-f194.google.com with SMTP id go14so5589582plb.0 for ; Sun, 01 Sep 2019 12:23:48 -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=MYmyqV51fBjQuhWN4wRJPBtp4cf5jebojptEpCVLVOk=; b=TjHWNZc0ZSAdLlICAmRNnY+1VKMb8ksQKlv2+3dqXX/Od6eAOEyRzvUwKpJvFshVrH HrrR7AzO7vyxkqqq8e3qYBKsKhC710WpwJN5/HLGqabKuwsVKvT8Sxq69tP2BrP4baWQ TA1MQp/Z3dMDgmRYKP/hQw4iGFquZ8eBXYA2xQazOg9QcT0Mqd4MnqWbbiBmuBpqBjle PLMS6HCjOTxicYWnq0Tbkd59InVsarbuDZZylarrhkkwwRu1H69HlAunEjCuH+pw53pV iqK/4yVXBpneAsahpXA1yg5WXLEApVp2prY059J8ZTkETMIFe9z2++wpWf0qXGy8sUHH AT5Q== 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=MYmyqV51fBjQuhWN4wRJPBtp4cf5jebojptEpCVLVOk=; b=RakH8+iVwmdURcA8x0yYXOjvh16LAM55g0Iq+7YgVN/MHx+phEAme6yD+gJfgHb2U5 i67ZMLhuYT4rafuPWrxTLzOrCfCg8GOEfu+Wo2yGin6lLfkflXO6kFbcy44m0qX5rdrb aYtwj3WuPfygCRK3s9XltRwWqrSTSuV2XgSsAUZCBViyH2ov8bNUlnjduTeChpmUIOt/ rxDRijwembDUcELMhu2UdiBfDy801HLF9mWmpb5Os8m9HtIxX63uc8tiTS1wdzK8rt27 cX2052zLQGguuUnDp5ZsTV+UlxzSkDMd9odHhxmBKrCSf7rf71y2p3ECItN9zIoalccr Osuw== X-Gm-Message-State: APjAAAX+JkIAZkYRr6CJnYUCxZNqMcBK+7el8mMdKtkRnGL8BKvkHnLU Bopj8VCdjlOL9WTumRAUV0eQkstI X-Received: by 2002:a17:902:744a:: with SMTP id e10mr20291723plt.239.1567365828132; Sun, 01 Sep 2019 12:23:48 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC.domain.name ([106.51.20.96]) by smtp.gmail.com with ESMTPSA id s7sm21910679pfb.138.2019.09.01.12.23.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 Sep 2019 12:23:46 -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, Souptick Joarder Subject: [PATCH] swiotlb-zen: Convert to use macro Date: Mon, 2 Sep 2019 00:58:56 +0530 Message-Id: <1567366136-874-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 --- 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