From patchwork Sun Sep 1 19:28:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 11125633 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 06C8316B1 for ; Sun, 1 Sep 2019 19:25:12 +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 D283E2190F for ; Sun, 1 Sep 2019 19:25:11 +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="TjHWNZc0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D283E2190F 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 1i4VS2-00081E-Lm; Sun, 01 Sep 2019 19:23:50 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i4VS1-000819-Pm for xen-devel@lists.xenproject.org; Sun, 01 Sep 2019 19:23:49 +0000 X-Inumbo-ID: 05f372f2-ccee-11e9-ac23-bc764e2007e4 Received: from mail-pl1-x641.google.com (unknown [2607:f8b0:4864:20::641]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 05f372f2-ccee-11e9-ac23-bc764e2007e4; Sun, 01 Sep 2019 19:23:48 +0000 (UTC) Received: by mail-pl1-x641.google.com with SMTP id b10so517531plr.4 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=WXQfkGPpq5cPUSRPsz2SBD2l7cCXjMTGoRgUaLizjzyJgyWFMtUMSWBFyOYVXUdsen oYDOvAQgzAKBY+7blDXrpycCo+OswiiAhVVshYqqkvK3/1rs3TYOUwpY/63xrjPyN7Dp XlCCcMnipkDKTI1nYb/KUeTE1saQEQZyC0OWv5GhEcubI36q1geszwEGH5/4gWb+u06g +TImj0JrA6OUmCuZnonqWl5dtkFC72r834B1WpZyX6SCf0ibSC4oVcHc88BPzhzPoZE+ 8EZsoZx57j9MbV4EEBleLrOOUiO9eMsEYB/04ZtN/H3apMC/1UumR6MmKE++ebR6Ahxu U77A== X-Gm-Message-State: APjAAAUcXGbXSBE1KJj6QjQ06LjzSWdufCTs/SOHxWqU6Vwq96GieMWD sw9goxrS5oMpAXpEH9s9KD4= X-Google-Smtp-Source: APXvYqxVwAyX5i9CZCLq1N9HsR4W+F1HPa3PbBb79wf4iu91tGmUo6frN78M/h5qjGemTUYvUXOSQQ== 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 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 Subject: [Xen-devel] [PATCH] swiotlb-zen: 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: xen-devel@lists.xenproject.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Souptick Joarder 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;