From patchwork Mon Sep 2 08:39:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 11126151 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A7D21890 for ; Mon, 2 Sep 2019 08:36:14 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E6DE12190F for ; Mon, 2 Sep 2019 08:36:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cYu84DUj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6DE12190F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i4hnd-0005NS-GV; Mon, 02 Sep 2019 08:34:57 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i4hnc-0005NJ-Ah for xen-devel@lists.xenproject.org; Mon, 02 Sep 2019 08:34:56 +0000 X-Inumbo-ID: 8a63f84a-cd5c-11e9-b95f-bc764e2007e4 Received: from mail-pg1-x542.google.com (unknown [2607:f8b0:4864:20::542]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8a63f84a-cd5c-11e9-b95f-bc764e2007e4; Mon, 02 Sep 2019 08:34:55 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id p3so7119426pgb.9 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=IpSs9CBYgS8z/7Fzo9MWjkFbxuCZYpJrms+nhkS0m0wyL2MFz/oIvfRgtmKYLHSbGn VFe4J3sugrh5Sv3w7oswPQK8+P0YfB1rdQCTRTeLLHOrD7nhE4vp+Q6jULuFqXR4kepP jem4aNUu/Yl4oxRNwnxHxsUl+9qwMSqteKkEt5sLjqt5CsRFAijpSby65cjvL7Tb3X57 65tQEaFDXkLQg0uuqGvHBwzG5Vu6s36D76pkUowV/TApZHMMh02Vryo6K6bkq/I+4o2n M4co4QopSoRfOiuKnZ1ujqxMvPFRj1EsvbyQl7vawWgqTGwbU7g9ZshKbcdM52tFXGuK vOCw== X-Gm-Message-State: APjAAAWTS53x+p07iWcaKLbdCJd5rNO599yyiJqti9jdiyojpF1h5jmA tliNqNFK6++4PQSrqdyY4gE= X-Google-Smtp-Source: APXvYqykyTr1V1UXoAhEng9PvF5ygE64bFW8pzDF90EN8gbWoiWOHtdCIKRzyJWgs9NYY7KHzCPF3A== 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 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 Subject: [Xen-devel] [PATCH v2] swiotlb-xen: Convert to use macro X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Souptick Joarder , xen-devel@lists.xenproject.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, sabyasachi.linux@gmail.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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;