]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
media: platform: fix some 64-bits warnings
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 11 Apr 2018 13:33:18 +0000 (09:33 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 17 Apr 2018 09:50:00 +0000 (05:50 -0400)
The omap/omap3 and viu drivers are for 32 bit platforms only.
There, a pointer has 32 bits. Now that those drivers build
for 64 bits with COMPILE_TEST, they produce the following
warnings:

drivers/media/platform/omap/omap_vout_vrfb.c: In function 'omap_vout_allocate_vrfb_buffers':
drivers/media/platform/omap/omap_vout_vrfb.c:57:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   memset((void *) vout->smsshado_virt_addr[i], 0,
          ^
drivers/media/platform/fsl-viu.c: In function 'viu_setup_preview':
drivers/media/platform/fsl-viu.c:753:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  reg_val.field_base_addr = (u32)dev->ovbuf.base;
                            ^
drivers/media/platform/omap/omap_vout.c: In function 'omap_vout_get_userptr':
drivers/media/platform/omap/omap_vout.c:209:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   *physp = virt_to_phys((void *)virtp);
                         ^
drivers/media/platform/omap3isp/ispccdc.c: In function 'ccdc_config':
drivers/media/platform/omap3isp/ispccdc.c:738:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
         (__force void __user *)fpc.fpcaddr,
         ^

Add some typecasts to remove those warnings when building for
64 bits.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/fsl-viu.c
drivers/media/platform/omap/omap_vout.c
drivers/media/platform/omap/omap_vout_vrfb.c
drivers/media/platform/omap3isp/ispccdc.c

index 5b6bfcafc2a4bb117a32f943db4175071436c8ff..e41510ce69a4081525b777824ae18b5750637fca 100644 (file)
@@ -750,7 +750,7 @@ static int viu_setup_preview(struct viu_dev *dev, struct viu_fh *fh)
        reg_val.status_cfg |= DMA_ACT | INT_DMA_END_EN | INT_FIELD_EN;
 
        /* setup the base address of the overlay buffer */
-       reg_val.field_base_addr = (u32)dev->ovbuf.base;
+       reg_val.field_base_addr = (u32)(long)dev->ovbuf.base;
 
        return 0;
 }
index e2723fedac8dd2a6112dbed6ed9e9f2846364381..5700b7818621de4d91fa562e3515b2be09c8ba08 100644 (file)
@@ -198,7 +198,7 @@ static int omap_vout_try_format(struct v4l2_pix_format *pix)
  * omap_vout_get_userptr: Convert user space virtual address to physical
  * address.
  */
-static int omap_vout_get_userptr(struct videobuf_buffer *vb, u32 virtp,
+static int omap_vout_get_userptr(struct videobuf_buffer *vb, long virtp,
                                 u32 *physp)
 {
        struct frame_vector *vec;
index 1d8508237220f25350bbf2f0da6dc281980255a2..29e3f5da59c1ff61137f66d93b75b865521ed5e1 100644 (file)
@@ -54,8 +54,8 @@ static int omap_vout_allocate_vrfb_buffers(struct omap_vout_device *vout,
                        *count = 0;
                        return -ENOMEM;
                }
-               memset((void *) vout->smsshado_virt_addr[i], 0,
-                               vout->smsshado_size);
+               memset((void *)(long)vout->smsshado_virt_addr[i], 0,
+                      vout->smsshado_size);
        }
        return 0;
 }
index b66276ab5765d61a5c52cf1ab09ff80a748df80e..77b73e27a2746bf086d1bf86c7cb252582c94316 100644 (file)
@@ -735,7 +735,7 @@ static int ccdc_config(struct isp_ccdc_device *ccdc,
                                return -ENOMEM;
 
                        if (copy_from_user(fpc_new.addr,
-                                          (__force void __user *)fpc.fpcaddr,
+                                          (__force void __user *)(long)fpc.fpcaddr,
                                           size)) {
                                dma_free_coherent(isp->dev, size, fpc_new.addr,
                                                  fpc_new.dma);