Skip to contentSkip to conversation

nouveau: Fix missing types on shift

PATCH New Alan 1 participant 1 message Feb 17, 2016

Subsystems (3)
lore
Share & tools
lore

Alan

author
#0 lore raw

PATCH 1/1 nouveau: Fix missing types on shift

Shifting 1 into a u64 doesn't do what you might expect. Force the width before shifting.

---
 drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gf100.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gf100.c +1 -1
index 7ac507c..6867746 100644
@@ -103,7 +103,7 @@ static void
 gf100_vm_map(struct nvkm_vma *vma, struct nvkm_memory *pgt,
 	     struct nvkm_mem *mem, u32 pte, u32 cnt, u64 phys, u64 delta)
 {
-	u64 next = 1 << (vma->node->type - 8);
+	u64 next = 1ULL << (vma->node->type - 8);
 
 	phys  = gf100_vm_addr(vma, phys, mem->memtype, 0);
 	pte <<= 3;

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel