drm/ttm: Fix a potential comparison of structs.
authorThomas Hellstrom <thellstrom@vmware.com>
Fri, 31 Jul 2009 08:47:51 +0000 (10:47 +0200)
committerDave Airlie <airlied@redhat.com>
Tue, 4 Aug 2009 03:41:04 +0000 (13:41 +1000)
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>
drivers/gpu/drm/ttm/ttm_bo_util.c

index ce2e6f38ea01ed06cafa029f708f4266b0ccec7a..ad4ada07c6cfbdd1ba2c7775f120b4431293920e 100644 (file)
@@ -150,7 +150,7 @@ static int ttm_copy_io_ttm_page(struct ttm_tt *ttm, void *src,
 #ifdef CONFIG_X86
        dst = kmap_atomic_prot(d, KM_USER0, prot);
 #else
-       if (prot != PAGE_KERNEL)
+       if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL))
                dst = vmap(&d, 1, 0, prot);
        else
                dst = kmap(d);
@@ -163,7 +163,7 @@ static int ttm_copy_io_ttm_page(struct ttm_tt *ttm, void *src,
 #ifdef CONFIG_X86
        kunmap_atomic(dst, KM_USER0);
 #else
-       if (prot != PAGE_KERNEL)
+       if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL))
                vunmap(dst);
        else
                kunmap(d);
@@ -186,7 +186,7 @@ static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst,
 #ifdef CONFIG_X86
        src = kmap_atomic_prot(s, KM_USER0, prot);
 #else
-       if (prot != PAGE_KERNEL)
+       if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL))
                src = vmap(&s, 1, 0, prot);
        else
                src = kmap(s);
@@ -199,7 +199,7 @@ static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst,
 #ifdef CONFIG_X86
        kunmap_atomic(src, KM_USER0);
 #else
-       if (prot != PAGE_KERNEL)
+       if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL))
                vunmap(src);
        else
                kunmap(s);