From 7d05a8e09a0615b87060eadce9fd10ec0697b93b Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Thu, 14 Sep 2017 11:52:35 +0900 Subject: [PATCH] LOCAL / fbdev: bcm2708_fb: fix build warnings on 64bit build There are build warnings on arm64 build. Fix following build warnings: drivers/video/fbdev/bcm2708_fb.c: In function 'vc_mem_copy': drivers/video/fbdev/bcm2708_fb.c:507:49: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t {aka long unsigned int}' [-Wformat=] pr_err("[%s]: failed to dma_alloc_coherent(%d)\n", ^ drivers/video/fbdev/bcm2708_fb.c:516:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] unsigned char *p = (unsigned char *)ioparam.src + offset; ^ drivers/video/fbdev/bcm2708_fb.c: In function 'bcm2708_fb_probe': drivers/video/fbdev/bcm2708_fb.c:844:9: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=] pr_info("BCM2708FB: allocated DMA memory %08x\n", ^~~~~~ This only fixes the warnings, but functionality of fb_dmacopy is already broken on ARM64. Change-Id: Ib9035e38c79e668f74b47139c2a39faf937226db Signed-off-by: Seung-Woo Kim --- drivers/video/fbdev/bcm2708_fb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/bcm2708_fb.c b/drivers/video/fbdev/bcm2708_fb.c index 612293cf9f1b..bb3983f6bd86 100644 --- a/drivers/video/fbdev/bcm2708_fb.c +++ b/drivers/video/fbdev/bcm2708_fb.c @@ -504,7 +504,7 @@ static long vc_mem_copy(struct bcm2708_fb *fb, unsigned long arg) buf = dma_alloc_coherent(fb->fb.device, PAGE_ALIGN(size), &bus_addr, GFP_ATOMIC); if (!buf) { - pr_err("[%s]: failed to dma_alloc_coherent(%d)\n", + pr_err("[%s]: failed to dma_alloc_coherent(%zu)\n", __func__, size); rc = -ENOMEM; goto out; @@ -513,7 +513,7 @@ static long vc_mem_copy(struct bcm2708_fb *fb, unsigned long arg) for (offset = 0; offset < ioparam.length; offset += size) { size_t remaining = ioparam.length - offset; size_t s = min(size, remaining); - unsigned char *p = (unsigned char *)ioparam.src + offset; + unsigned char *p = (unsigned char *)(uintptr_t)ioparam.src + offset; unsigned char *q = (unsigned char *)ioparam.dst + offset; dma_memcpy(fb, bus_addr, INTALIAS_L1L2_NONALLOCATING((dma_addr_t)p), size); if (copy_to_user(q, buf, s) != 0) { @@ -841,8 +841,8 @@ static int bcm2708_fb_probe(struct platform_device *dev) goto free_fb; } - pr_info("BCM2708FB: allocated DMA memory %08x\n", - fb->cb_handle); + pr_info("BCM2708FB: allocated DMA memory %pad\n", + &fb->cb_handle); ret = bcm_dma_chan_alloc(BCM_DMA_FEATURE_BULK, &fb->dma_chan_base, &fb->dma_irq); -- 2.34.1