File u_Fix-compiler-warnings.patch of Package xf86-video-mga

From: Egbert Eich <eich@freedesktop.org>
Date: Wed May 7 21:23:40 2014 +0200
Subject: [PATCH]Fix compiler warnings
Patch-mainline: to be upstreamed
Git-commit: 9726dda8d50f6c79d0004ef254c500a8eed4c367
Git-repo: ssh://git.freedesktop.org/git/xorg/driver/xf86-video-mga
References: 
Signed-off-by: Egbert Eich <eich@suse.com>

Signed-off-by: Egbert Eich <eich@freedesktop.org>
---
 src/mga_driver.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/mga_driver.c b/src/mga_driver.c
index 08c836d..d3b25f0 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -1003,7 +1003,8 @@ MGASoftReset(ScrnInfoPtr pScrn)
 	MGAPtr pMga = MGAPTR(pScrn);
 
 	pMga->FbMapSize = 8192 * 1024;
-	MGAMapMem(pScrn);
+	if (!MGAMapMem(pScrn))
+            return;
 
 	/* set soft reset bit */
 	OUTREG(MGAREG_Reset, 1);
@@ -1124,7 +1125,8 @@ MGACountRam(ScrnInfoPtr pScrn)
 	    ProbeSize = 16384;
 	    ProbeSizeOffset = 0x10000;
 	    pMga->FbMapSize = ProbeSize * 1024;
-	    MGAMapMem(pScrn);
+	    if (!MGAMapMem(pScrn))
+                return 0;
 	    base = pMga->FbBase;
 	}
 
@@ -1164,7 +1166,8 @@ MGACountRam(ScrnInfoPtr pScrn)
             else {
                 MGAUnmapMem(pScrn);
                 pMga->FbMapSize = ProbeSize * 1024;
-                MGAMapMem(pScrn);
+                if (!MGAMapMem(pScrn))
+                    return 0;
                 base = pMga->FbBase;
             }
         }
@@ -2746,7 +2749,7 @@ MGAMapMem(ScrnInfoPtr pScrn)
 	    err = pci_device_map_range(dev,
 				       region->base_addr, region->size,
 				       PCI_DEV_MAP_FLAG_WRITABLE,
-				       &pMga->IOBase);
+				       (void **)&pMga->IOBase);
 
 	    if (err) {
 	      xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
openSUSE Build Service is sponsored by