>From 5e2851952729b287a82efa002b28a2095404d44d Mon Sep 17 00:00:00 2001
From: Thomas Hellstrom <thellst...@vmware.com>
Date: Fri, 31 Jul 2009 10:47:51 +0200
Subject: [PATCH] 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 <thellst...@vmware.com>

Signed-off-by: Pekka Paalanen <p...@iki.fi>
---

Thomas, you forgot two more of these :-)
Here's a patch that actually compiles on x86_64.

 drivers/gpu/drm/ttm/ttm_bo_util.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c 
b/drivers/gpu/drm/ttm/ttm_bo_util.c
index f4e2eba..999fbe7 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -151,7 +151,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);
@@ -164,7 +164,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);
@@ -187,7 +187,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);
@@ -200,7 +200,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);
-- 
1.6.3.3


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to