From patchwork Tue Dec 8 15:47:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7799351 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 43C409F1C2 for ; Tue, 8 Dec 2015 15:47:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F6C720523 for ; Tue, 8 Dec 2015 15:47:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8DB73204B5 for ; Tue, 8 Dec 2015 15:47:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C19246E20C; Tue, 8 Dec 2015 07:47:29 -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.17.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3CAF06E20C for ; Tue, 8 Dec 2015 07:47:27 -0800 (PST) Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0LkPhj-1ahInI0lFj-00cUpK; Tue, 08 Dec 2015 16:47:23 +0100 From: Arnd Bergmann To: David Airlie Subject: [PATCH] drm/sti: use u32 to store DMA addresses Date: Tue, 08 Dec 2015 16:47:21 +0100 Message-ID: <2721019.WUMgY8fC0D@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:oeAio0s0QHmks/oN7c2PNe19X4YIOnyMfqSSkeozjaweApDp97W BNTdJaPaEyXGKk5Zlq9cKJaIBUtvOXjIQw7fF+NDnt36jJ6JdWnjW20LJFBsY9RYqvwQRXO QKD8AHZSeRiuF/crlGb3vifXy0XIt3j+2rYXwCrPqBTvLHsO00RZVJWCzWsmilv4MhbkTpv wiiu4+b7dR5TpPgKXPETA== X-UI-Out-Filterresults: notjunk:1; V01:K0:Uz6oXZjZyak=:Pr2fpU5x8rmgtZZb+BYiVw 5wd7nU4SXWmJE898oMd01Pl73x+YxM7IwlMn5FkLjojisEhIxhUNuOhbQgCChQXjwqFTosZWO iIVa/KwYFAzB6gMP7JJqw5SwKOAaopMgn0/+wDOJB9CcuD7Fgqj627AfB6sdoMlClyshE1SMM ttoMSFGjciS4pOgyv3D2igkWXQk5YeiasBLKSrhKRcsUxkSqsCC3O8uemVyNwgmFFzzwplF0w 0zxvp6KZeR2fW8dUFrwm9M+dkjM2/yyi0r3u91UVXCkyA+pLJd0DL/bt4SBVt2PTVJkMUULAi PFX40rQtA0ARiDsOezPlwpf6ceexzG3ylddMJddDrm/xPWBAEAvuYciTaijAMCg+YCiuKmaHO zhdO6hakAALuzu2XACsKub0RQ3FAgdYYRcq0/Y/1IJ2gLhcJI6FA2+oeHDjdpscQ8EjQYujUU D+6QFsa7Jmv9R621qXOVyssScC1NtVcwaM8ADXdE7vm9S3/cUUgMU+NhGgQKaDYzzA/MZ2nji EwzZ+HKqKBaCYI1nv//GPesOGRN903daxSez0bpqLiWMGehyA34pK5HDGz0NHWpfjL8EU+9QM 4sEDG3Bu23VfsSFqpzsIKElVFe3E7I5ijNEuGg6imSB2Bq0BxbtErZNLng+U9Fyws/7AuItjc QcgFbIjcXxkOoO8LvC43w6a5dX/x5xPJtqI0ZvtuuOBxUAtmIFDvU4DekAIgc9PL4YByn0UWF t/Fh8cFHx0UiJ7w9 Cc: linux-arm-kernel@lists.infradead.org, Vincent Abriou , dri-devel@lists.freedesktop.org, Benjamin Gaignard , 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The STi drm driver correctly warns about invalid format strings when built with 64-bit dma_addr_t: sti_hqvdp.c: In function 'sti_hqvdp_vtg_cb': sti_hqvdp.c:605:119: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=] sti_hqvdp.c: In function 'sti_hqvdp_atomic_update': sti_hqvdp.c:931:118: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=] This could be changed to using the %pad format string, but that does not work when printing an rvalue, so instead I'm changing the type in the sti_hqvdp structure to u32, which is what gets written into the registers anyway. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/sti/sti_hqvdp.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index ea0690bc77d5..9d698e582011 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -349,7 +349,7 @@ struct sti_hqvdp { unsigned int curr_field_count; unsigned int last_field_count; void *hqvdp_cmd; - dma_addr_t hqvdp_cmd_paddr; + u32 hqvdp_cmd_paddr; struct sti_vtg *vtg; bool xp70_initialized; }; @@ -372,8 +372,8 @@ static const uint32_t hqvdp_supported_formats[] = { */ static int sti_hqvdp_get_free_cmd(struct sti_hqvdp *hqvdp) { - int curr_cmd, next_cmd; - dma_addr_t cmd = hqvdp->hqvdp_cmd_paddr; + u32 curr_cmd, next_cmd; + u32 cmd = hqvdp->hqvdp_cmd_paddr; int i; curr_cmd = readl(hqvdp->regs + HQVDP_MBX_CURRENT_CMD); @@ -400,8 +400,8 @@ static int sti_hqvdp_get_free_cmd(struct sti_hqvdp *hqvdp) */ static int sti_hqvdp_get_curr_cmd(struct sti_hqvdp *hqvdp) { - int curr_cmd; - dma_addr_t cmd = hqvdp->hqvdp_cmd_paddr; + u32 curr_cmd; + u32 cmd = hqvdp->hqvdp_cmd_paddr; unsigned int i; curr_cmd = readl(hqvdp->regs + HQVDP_MBX_CURRENT_CMD); @@ -612,19 +612,21 @@ int sti_hqvdp_vtg_cb(struct notifier_block *nb, unsigned long evt, void *data) static void sti_hqvdp_init(struct sti_hqvdp *hqvdp) { int size; + dma_addr_t dma_addr; hqvdp->vtg_nb.notifier_call = sti_hqvdp_vtg_cb; /* Allocate memory for the VDP commands */ size = NB_VDP_CMD * sizeof(struct sti_hqvdp_cmd); hqvdp->hqvdp_cmd = dma_alloc_writecombine(hqvdp->dev, size, - &hqvdp->hqvdp_cmd_paddr, + &dma_addr, GFP_KERNEL | GFP_DMA); if (!hqvdp->hqvdp_cmd) { DRM_ERROR("Failed to allocate memory for VDP cmd\n"); return; } + hqvdp->hqvdp_cmd_paddr = (u32)dma_addr; memset(hqvdp->hqvdp_cmd, 0, size); }