[media] videobuf2-vmalloc: fix sparse warning
authorHans Verkuil <hans.verkuil@cisco.com>
Sat, 13 Dec 2014 11:52:54 +0000 (08:52 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 23 Dec 2014 12:41:43 +0000 (10:41 -0200)
Fix this warning:

drivers/media/v4l2-core/videobuf2-vmalloc.c:98:28: warning: incorrect type in assignment (different address spaces)
drivers/media/v4l2-core/videobuf2-vmalloc.c:158:28: warning: incorrect type in argument 1 (different address spaces)

The warning is correct, but we have no other choice here to forcibly cast.
At least it is now explicit that such a cast is needed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/v4l2-core/videobuf2-vmalloc.c

index fba944e502271069c11f3b73328f7a4d8e457fe6..7f6d41b18de90cd5aca11db0e98bffc63bc96dca 100644 (file)
@@ -95,7 +95,7 @@ static void *vb2_vmalloc_get_userptr(void *alloc_ctx, unsigned long vaddr,
                if (vb2_get_contig_userptr(vaddr, size, &vma, &physp))
                        goto fail_pages_array_alloc;
                buf->vma = vma;
-               buf->vaddr = ioremap_nocache(physp, size);
+               buf->vaddr = (__force void *)ioremap_nocache(physp, size);
                if (!buf->vaddr)
                        goto fail_pages_array_alloc;
        } else {
@@ -155,7 +155,7 @@ static void vb2_vmalloc_put_userptr(void *buf_priv)
                kfree(buf->pages);
        } else {
                vb2_put_vma(buf->vma);
-               iounmap(buf->vaddr);
+               iounmap((__force void __iomem *)buf->vaddr);
        }
        kfree(buf);
 }