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: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Thomas Hellstrom 2009-07-31 10:47:51 +02:00 committed by Dave Airlie
parent 0924d94225
commit 6d0897ba58
1 changed files with 4 additions and 4 deletions

View File

@ -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,
#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,
#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,
#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);