From patchwork Tue May 24 06:28:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9132837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2BB336075E for ; Tue, 24 May 2016 06:30:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 233C02823B for ; Tue, 24 May 2016 06:30:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17EFE2824F; Tue, 24 May 2016 06:30:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D10B62823B for ; Tue, 24 May 2016 06:30:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b55pv-0007Vy-3z; Tue, 24 May 2016 06:29:03 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b55pd-0007Rl-MJ for linux-arm-kernel@lists.infradead.org; Tue, 24 May 2016 06:28:46 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O7O00ACM4N88S90@mailout3.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 24 May 2016 07:28:20 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-28-5743f4849410 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 44.83.05254.484F3475; Tue, 24 May 2016 07:28:20 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O7O00BQ04N2WW40@eusync4.samsung.com>; Tue, 24 May 2016 07:28:20 +0100 (BST) From: Krzysztof Kozlowski To: Russell King , Stefano Stabellini , Catalin Marinas , Will Deacon , Joerg Roedel , Konrad Rzeszutek Wilk , Andrew Morton , Marek Szyprowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, iommu@lists.linux-foundation.org Subject: [PATCH 3/4] arm64: dma-mapping: Constify attrs passed to internal functions Date: Tue, 24 May 2016 08:28:09 +0200 Message-id: <1464071290-15948-4-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1464071290-15948-1-git-send-email-k.kozlowski@samsung.com> References: <1464071290-15948-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrALMWRmVeSWpSXmKPExsVy+t/xa7otX5zDDda/Y7OYs34Nm8XGGetZ Ld4v62G0WLDf2qJz9gZ2i9cvDC2WLX7KaLHp8TVWi8u75rBZHJq6l9Fi7ZG77Bar18VbvPx4 gsXi+5bJTA58Hk8OzmPyWDNvDaPH5WsXmT02repk8zgx4zeLx+Yl9R6Tbyxn9Dj84QqLx8en t1g8+rasYvT4vEkugDuKyyYlNSezLLVI3y6BK+PinyXsBfu4Ky7d+cfYwLiZs4uRk0NCwETi 7ZS1bBC2mMSFe+uBbC4OIYGljBJb978GSwgJNDJJrLoZAmKzCRhLbF6+BKxIROAhs8SZWX9Z QBLMApkSnXvnsoPYwgJhEqenfmXqYuTgYBFQldjz0BgkzCvgLrHlyiGoZXISJ49NZgWxOQU8 JBpPH2CB2OUuMW32RfYJjLwLGBlWMYqmliYXFCel5xrqFSfmFpfmpesl5+duYoSE85cdjIuP WR1iFOBgVOLhDch3DhdiTSwrrsw9xCjBwawkwrv8OlCINyWxsiq1KD++qDQntfgQozQHi5I4 79xd70OEBNITS1KzU1MLUotgskwcnFINjCJPblavbDJPPvL11oanU+N9PPr0NbQ4DRYc0YpQ 2OrclK+7fovQrA0SEx3/8vFHJC+XumGTt1eqcKPBvwKGUIevj/vrz2carxF4WLXTdKnNXUlt pqk3VjzKfcZ+d0rQOb2Fmy8F/T0rcemv4QZPc7Y0/zqzT02eNs3Ga64unlTkuyDx33EWfSWW 4oxEQy3mouJEAEDpaN5jAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160523_232845_892960_20A5AD78 X-CRM114-Status: GOOD ( 14.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Some of the non-exported functions do not modify passed dma_attrs so the pointer can point to const data. Signed-off-by: Krzysztof Kozlowski --- arch/arm64/mm/dma-mapping.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index c566ec83719f..0ef620a34c4e 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c @@ -29,7 +29,7 @@ #include -static pgprot_t __get_dma_pgprot(struct dma_attrs *attrs, pgprot_t prot, +static pgprot_t __get_dma_pgprot(const struct dma_attrs *attrs, pgprot_t prot, bool coherent) { if (!coherent || dma_get_attr(DMA_ATTR_WRITE_COMBINE, attrs)) @@ -88,7 +88,7 @@ static int __free_from_pool(void *start, size_t size) static void *__dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flags, - struct dma_attrs *attrs) + const struct dma_attrs *attrs) { if (dev == NULL) { WARN_ONCE(1, "Use an actual device structure for DMA allocation\n"); @@ -118,7 +118,7 @@ static void *__dma_alloc_coherent(struct device *dev, size_t size, static void __dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle, - struct dma_attrs *attrs) + const struct dma_attrs *attrs) { bool freed; phys_addr_t paddr = dma_to_phys(dev, dma_handle);