drm/i915/gvt: fix bad 32 bit shift in gtt
authorJérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Thu, 20 Oct 2016 22:05:57 +0000 (18:05 -0400)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Tue, 25 Oct 2016 02:35:54 +0000 (10:35 +0800)
Since ioread32 returns a 32-bit value, it is impossible to left-shift
this value by 32 bits (it produces a compilation error). Casting the
return value of ioread32 fix this issue.

Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/gtt.c

index 2cc7613..b35bda0 100644 (file)
@@ -276,7 +276,7 @@ static u64 read_pte64(struct drm_i915_private *dev_priv, unsigned long index)
        pte = readq(addr);
 #else
        pte = ioread32(addr);
-       pte |= ioread32(addr + 4) << 32;
+       pte |= (u64)ioread32(addr + 4) << 32;
 #endif
        return pte;
 }