From: Seung-Woo Kim Date: Thu, 14 Sep 2017 02:52:35 +0000 (+0900) Subject: LOCAL / fbdev: bcm2708_fb: fix build warnings on 64bit build X-Git-Tag: submit/tizen/20180904.010142~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=081d84f9b372f0635c20c9065658cf70d140575c;p=platform%2Fkernel%2Flinux-rpi3.git 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 --- diff --git a/drivers/video/fbdev/bcm2708_fb.c b/drivers/video/fbdev/bcm2708_fb.c index 6c9ee9ca8ee2..1b5815f09119 100644 --- a/drivers/video/fbdev/bcm2708_fb.c +++ b/drivers/video/fbdev/bcm2708_fb.c @@ -524,7 +524,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; @@ -533,7 +533,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, @@ -865,8 +865,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);