drm/vmwgfx: Fix compiler warning with 32-bit dma_addr_t
authorThomas Hellstrom <thellstrom@vmware.com>
Tue, 4 Aug 2015 13:34:14 +0000 (15:34 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 5 Aug 2015 12:01:11 +0000 (14:01 +0200)
When the size of dma_addr_t was 32 bits, the compiler warned
about the size of the 32 bit shift being larger than the size
of the data type.

Reported by Intel's kbuild robot.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c

index 32ec52eaedd81fe80a7b0e2674dfa711adef212c..afc6d1df47d7081ced2f5e2110b40bed23900222 100644 (file)
@@ -293,8 +293,12 @@ static int vmw_cmdbuf_header_submit(struct vmw_cmdbuf_header *header)
        struct vmw_cmdbuf_man *man = header->man;
        u32 val;
 
-       val = (header->handle >> 32);
+       if (sizeof(header->handle) > 4)
+               val = (header->handle >> 32);
+       else
+               val = 0;
        vmw_write(man->dev_priv, SVGA_REG_COMMAND_HIGH, val);
+
        val = (header->handle & 0xFFFFFFFFULL);
        val |= header->cb_context & SVGA_CB_CONTEXT_MASK;
        vmw_write(man->dev_priv, SVGA_REG_COMMAND_LOW, val);