Commit 6d0897ba authored by Thomas Hellstrom's avatar Thomas Hellstrom Committed by Dave Airlie

drm/ttm: Fix a potential comparison of structs.

On some architectures the comparison may cause a compilation failure.

Original partial fix Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: default avatarPekka Paalanen <pq@iki.fi>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 0924d942
...@@ -150,7 +150,7 @@ static int ttm_copy_io_ttm_page(struct ttm_tt *ttm, void *src, ...@@ -150,7 +150,7 @@ static int ttm_copy_io_ttm_page(struct ttm_tt *ttm, void *src,
#ifdef CONFIG_X86 #ifdef CONFIG_X86
dst = kmap_atomic_prot(d, KM_USER0, prot); dst = kmap_atomic_prot(d, KM_USER0, prot);
#else #else
if (prot != PAGE_KERNEL) if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL))
dst = vmap(&d, 1, 0, prot); dst = vmap(&d, 1, 0, prot);
else else
dst = kmap(d); dst = kmap(d);
...@@ -163,7 +163,7 @@ static int ttm_copy_io_ttm_page(struct ttm_tt *ttm, void *src, ...@@ -163,7 +163,7 @@ static int ttm_copy_io_ttm_page(struct ttm_tt *ttm, void *src,
#ifdef CONFIG_X86 #ifdef CONFIG_X86
kunmap_atomic(dst, KM_USER0); kunmap_atomic(dst, KM_USER0);
#else #else
if (prot != PAGE_KERNEL) if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL))
vunmap(dst); vunmap(dst);
else else
kunmap(d); kunmap(d);
...@@ -186,7 +186,7 @@ static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst, ...@@ -186,7 +186,7 @@ static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst,
#ifdef CONFIG_X86 #ifdef CONFIG_X86
src = kmap_atomic_prot(s, KM_USER0, prot); src = kmap_atomic_prot(s, KM_USER0, prot);
#else #else
if (prot != PAGE_KERNEL) if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL))
src = vmap(&s, 1, 0, prot); src = vmap(&s, 1, 0, prot);
else else
src = kmap(s); src = kmap(s);
...@@ -199,7 +199,7 @@ static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst, ...@@ -199,7 +199,7 @@ static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst,
#ifdef CONFIG_X86 #ifdef CONFIG_X86
kunmap_atomic(src, KM_USER0); kunmap_atomic(src, KM_USER0);
#else #else
if (prot != PAGE_KERNEL) if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL))
vunmap(src); vunmap(src);
else else
kunmap(s); kunmap(s);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment