From patchwork Mon Jan 25 15:36:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101128 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1428739lbb; Mon, 25 Jan 2016 07:36:41 -0800 (PST) X-Received: by 10.66.162.164 with SMTP id yb4mr26777545pab.94.1453736201018; Mon, 25 Jan 2016 07:36:41 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id u16si34334460pfa.225.2016.01.25.07.36.40; Mon, 25 Jan 2016 07:36:40 -0800 (PST) Received-SPF: pass (google.com: domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 014F06E05C; Mon, 25 Jan 2016 07:36:40 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) by gabe.freedesktop.org (Postfix) with ESMTPS id C48986E05C for ; Mon, 25 Jan 2016 07:36:38 -0800 (PST) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue004) with ESMTPA (Nemesis) id 0LuHH1-1Zw42P3Upj-011hw8; Mon, 25 Jan 2016 16:36:34 +0100 From: Arnd Bergmann To: Russell King , David Airlie Subject: [PATCH] drm: armada: use dma_addr_t properly Date: Mon, 25 Jan 2016 16:36:25 +0100 Message-Id: <1453736189-1958878-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:zvoPTRNOLo3wpk5sWEjV1Trw5WgmYyYQwiWvOcXMHGnD1WtEUHW fetuIzd/D3fmeLmvp44Ymbyvu5JEnPsHYO0tTG2W6vHcF8TvhWUWoxPTiAVhy8quvdU6S5m OygXPmT6ffbINzPGyoNrE+8z4ZIlG6gPE4UQ1OeLDA0sKRbqIZ5rEQxUb62oJs1DxON60YJ Xo1joocP1BRp4itN4CxxQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:sLf4IY2g7qI=:SQUyW3cR5PphG90Ddj2FZQ 1ALSJHnUmzkkS+jcJ866/IDJ67w6UVnu5BK7jncmmZ4NUKv3v+/dDyu4IDOPUhtBfgFHFCrwP rzkOw8e8ICspj9k+KtEAdPNGtmzl4g4iw1ptEOR2yHXR+RmXadF9lFjVqGTgmV9D7ILbaH2b0 nHv+Nx+lGMWVu/vEjsSwKPMlIDmdSaZ3lByIC78jQXOOAFYHmQQNwHo1Ya6PSJIQKIeXJWG/b AZT1j7nNrDE6UK7G0taCDO4sCcVnxu2Y6YAxGVk0h8mE+Rtbib8qIJ4CVIb8Mw5je8h3KC91i WEtyxJ6cmILNb2KqXpL0yDWZaxKaE3tMexZEyeKdCvDjLrozeK97E7BMfDm0kG8AtQvZ+t7JF vJeAxmnxbYkxgxYdAPPLbLAOoBantQpfU4sSxL5xvl8J3709PdZ+qhNBtvGNWtzGyrTUvYYcU GqHqscBhS9tw0FO/kWJaE81wSxtgX4akoXVxj+vy3mwLQu4nPPYGq8m7mP6I0T83O3k34D4Tp 4g8NnVe1dDT7cjPtqsW97GfeFrFO59Ht5jXxGQagK0NQiJ5JortqbwrjxTytrxY/azDj9mi/8 zyoNe2QrcHfNTEgbnakvFV3HHuk+YcvP9ddirFPde4G+DgGNRB+E57eJgR+Exk4KNYM5DuL6P qRz0OIZM8I58nEtFu1PPkauwWr782vnrq52DSd6lZquuXSm9C5VEBc6BEctlZ83EAx0o= Cc: dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The armada_gem driver stores a DMA address token in a resource_size_t. This is safe because both are always at least 32 bits wide and can store any address that is accessible by this driver. However, it is a slight type mismatch when we assign it from/to an sg_dma_address() value, and we get a warning in any configuration in which resource_size_t is shorter than dma_addr_t: drivers/gpu/drm/armada/armada_gem.c: In function 'armada_gem_alloc_private_object': arch/arm/include/asm/dma-mapping.h:16:24: warning: large integer implicitly truncated to unsigned type [-Woverflow] #define DMA_ERROR_CODE (~(dma_addr_t)0x0) ^ drivers/gpu/drm/armada/armada_gem.c:204:18: note: in expansion of macro 'DMA_ERROR_CODE' obj->dev_addr = DMA_ERROR_CODE; ^ Changing the type to dma_addr_t solves both issues. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/armada/armada_gem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/armada/armada_gem.h b/drivers/gpu/drm/armada/armada_gem.h index b000ea3a829a..270cff02c1cd 100644 --- a/drivers/gpu/drm/armada/armada_gem.h +++ b/drivers/gpu/drm/armada/armada_gem.h @@ -15,7 +15,7 @@ struct armada_gem_object { struct drm_gem_object obj; void *addr; phys_addr_t phys_addr; - resource_size_t dev_addr; + dma_addr_t dev_addr; struct drm_mm_node *linear; /* for linear backed */ struct page *page; /* for page backed */ struct sg_table *sgt; /* for imported */