xf86-video-msm (1.0.1+git20100122.5f7df591-3) 01_fix_obsolete_x_functioncall.patch

Summary

 src/msm-dri.c    |    8 ++++----
 src/msm-dri2.c   |   20 ++++++++++----------
 src/msm-driver.c |   34 +++++++++++++++++-----------------
 src/msm-drm.c    |    4 ++--
 src/msm-exa.c    |    6 +++---
 src/msm-pixmap.c |    6 +++---
 src/msm-video.c  |    6 +++---
 7 files changed, 42 insertions(+), 42 deletions(-)

    
download this patch

Patch contents

Description: Remove obsolete xfree, xmalloc, xcalloc calls
 xfree() -> free()
 xmalloc() -> malloc()
 xcalloc() -> calloc()
Author: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Last-Update: 2011-08-03
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-dri.c
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm-dri.c	2011-08-02 13:37:04.000000000 +0000
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-dri.c	2011-08-02 13:49:44.000000000 +0000
@@ -97,7 +97,7 @@
 	 pMsm->dri->pDRIInfo->devPrivate;
 
    if (pMSMDRI)
-      xfree(pMSMDRI);
+      free(pMSMDRI);
 
    DRICloseScreen(pScreen);
    DRIDestroyInfoRec(pMsm->dri->pDRIInfo);
@@ -144,7 +144,7 @@
 
    pDRIInfo->drmDriverName = "msm_kgsl";
    pDRIInfo->clientDriverName = "yamato";
-   pDRIInfo->busIdString = xalloc(16);
+   pDRIInfo->busIdString = malloc(16);
    strcpy(pDRIInfo->busIdString, "platform:kgsl");
 
    pDRIInfo->ddxDriverMajorVersion = 1;
@@ -166,7 +166,7 @@
 
    pDRIInfo->SAREASize = SAREA_MAX;
 
-   pMSMDRI = (MSMDRIPrivPtr) xcalloc(1, sizeof(*pMSMDRI));
+   pMSMDRI = (MSMDRIPrivPtr) calloc(1, sizeof(*pMSMDRI));
 
    if (pMSMDRI == NULL) {
       DRIDestroyInfoRec(pMsm->dri->pDRIInfo);
@@ -195,7 +195,7 @@
    if (!DRIScreenInit(pScreen, pDRIInfo, &pMsm->dri->drmFD)) {
       xf86DrvMsg(pScreen->myNum, X_ERROR,
 		 "MSM-DRI DRIScreenInit failed.  Disabling DRI.\n");
-      xfree(pDRIInfo->devPrivate);
+      free(pDRIInfo->devPrivate);
       pDRIInfo->devPrivate = NULL;
       DRIDestroyInfoRec(pDRIInfo);
       pDRIInfo = NULL;
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-driver.c
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm-driver.c	2011-08-02 13:37:04.000000000 +0000
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-driver.c	2011-08-02 13:50:22.000000000 +0000
@@ -387,7 +387,7 @@
    if (pMsm->fd < 0) {
       xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		 "Opening '%s' failed: %s\n", dev, strerror(errno));
-      xfree(pMsm);
+      free(pMsm);
       return FALSE;
    }
 
@@ -403,7 +403,7 @@
       xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		 "Unable to read hardware info from %s: %s\n",
 		 dev, strerror(errno));
-      xfree(pMsm);
+      free(pMsm);
       return FALSE;
    }
 
@@ -414,7 +414,7 @@
 
       xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		 "Unable to determine the MDP and panel type\n");
-      xfree(pMsm);
+      free(pMsm);
       return FALSE;
    }
 
@@ -443,7 +443,7 @@
 		 "Unable to read the current mode from %s: %s\n",
 		 dev, strerror(errno));
 
-      xfree(pMsm);
+      free(pMsm);
       return FALSE;
    }
 
@@ -454,7 +454,7 @@
        && pMsm->mode_info.bits_per_pixel != 24) {
       xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		 "The driver can only support 16bpp and 24bpp output\n");
-      xfree(pMsm);
+      free(pMsm);
       return FALSE;
    }
 
@@ -476,7 +476,7 @@
 	default:
 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 			"The driver can only support 16bpp and 24bpp output\n");
-		xfree(pMsm);
+		free(pMsm);
 		return FALSE;
    }
 
@@ -484,7 +484,7 @@
 			Support24bppFb | Support32bppFb |
 			SupportConvert32to24 | SupportConvert24to32)) {
       ErrorF("Unable to set bitdepth\n");
-      xfree(pMsm);
+      free(pMsm);
       return FALSE;
    }
 
@@ -492,13 +492,13 @@
    pScrn->rgbBits = 8;
 
    if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight)) {
-      xfree(pMsm);
+      free(pMsm);
       return FALSE;
    }
 
    /* Initialize default visual */
    if (!xf86SetDefaultVisual(pScrn, -1)) {
-      xfree(pMsm);
+      free(pMsm);
       return FALSE;
    }
 
@@ -506,7 +506,7 @@
       Gamma zeros = { 0.0, 0.0, 0.0 };
 
       if (!xf86SetGamma(pScrn, zeros)) {
-         xfree(pMsm);
+         free(pMsm);
 	 return FALSE;
       }
    }
@@ -526,10 +526,10 @@
    /* We need to allocate this memory here because we have multiple
     * screens, and we can't go writing on the MSMOptions structure */
 
-   options = xalloc(sizeof(MSMOptions));
+   options = malloc(sizeof(MSMOptions));
 
    if (options == NULL) {
-      xfree(pMsm);
+      free(pMsm);
       return FALSE;
    }
 
@@ -640,7 +640,7 @@
     * I don't see any reason to do that unless we have other functions
     * that need it */
 
-   xfree(options);
+   free(options);
 
 #if USEDRI2
    if (pMsm->useDRI2 && !MSMInitDRM(pScrn)) {
@@ -722,7 +722,7 @@
    MSMOutputSetup(pScrn);
 
    if (!xf86InitialConfiguration(pScrn, FALSE)) {
-      xfree(pMsm);
+      free(pMsm);
       return FALSE;
    }
 
@@ -800,7 +800,7 @@
    /* Close EXA */
    if (pMsm->accel && pMsm->pExa) {
       exaDriverFini(pScreen);
-      xfree(pMsm->pExa);
+      free(pMsm->pExa);
       pMsm->pExa = NULL;
    }
 
@@ -902,7 +902,7 @@
 #if USEDRI
    pMsm->DRIEnabled = FALSE;
    if (!pMsm->useDRI2 && pMsm->useDRI) {
-     pMsm->dri = xcalloc(1, sizeof(struct msm_dri));
+     pMsm->dri = calloc(1, sizeof(struct msm_dri));
      pMsm->dri->depthBits = pScrn->depth;
      pMsm->DRIEnabled = MSMDRIScreenInit(pScreen);
    }
@@ -1139,7 +1139,7 @@
       }
    }
 
-   xfree(sections);
+   free(sections);
    return foundScreen;
 }
 
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-video.c
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm-video.c	2011-08-02 13:37:04.000000000 +0000
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-video.c	2011-08-02 13:51:39.000000000 +0000
@@ -704,7 +704,7 @@
 
    int i;
 
-   adapt = xcalloc(1, sizeof(XF86VideoAdaptorRec) +
+   adapt = calloc(1, sizeof(XF86VideoAdaptorRec) +
 		   (sizeof(DevUnion) * pMsm->xvports) +
 		   (sizeof(MSMPortPrivRec) * pMsm->xvports));
 
@@ -771,7 +771,7 @@
 
    count = xf86XVListGenericAdaptors(pScrn, &list);
 
-   newlist = xalloc((count + 1) * sizeof(XF86VideoAdaptorPtr *));
+   newlist = malloc((count + 1) * sizeof(XF86VideoAdaptorPtr *));
    if (newlist == NULL)
       return;
 
@@ -782,5 +782,5 @@
 
    xf86XVScreenInit(pScreen, newlist, count);
 
-   xfree(newlist);
+   free(newlist);
 }
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-dri2.c
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm-dri2.c	2011-08-02 13:37:04.000000000 +0000
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-dri2.c	2011-08-02 13:50:08.000000000 +0000
@@ -64,14 +64,14 @@
     PixmapPtr pixmap;
     int i;
 
-    buffers = xcalloc(count, sizeof(*buffers));
+    buffers = calloc(count, sizeof(*buffers));
     if (buffers == NULL)
 	return NULL;
 
-    privates = xcalloc(count, sizeof(struct msm_dri2_priv));
+    privates = calloc(count, sizeof(struct msm_dri2_priv));
 
     if (privates == NULL) {
-	xfree(buffers);
+	free(buffers);
 	return NULL;
     }
 
@@ -129,14 +129,14 @@
     struct msm_pixmap_priv *pixpriv;
     PixmapPtr pixmap;
 
-    buffer = xcalloc(1, sizeof(*buffer));
+    buffer = calloc(1, sizeof(*buffer));
     if (buffer == NULL)
 	return NULL;
 
-    private = xcalloc(1, sizeof(struct msm_dri2_priv));
+    private = calloc(1, sizeof(struct msm_dri2_priv));
 
     if (private == NULL) {
-	xfree(buffer);
+	free(buffer);
 	return NULL;
     }
 
@@ -205,8 +205,8 @@
 	(*pScreen->DestroyPixmap)(priv->pixmap);
     }
 
-    xfree(buffers[0].driverPrivate);
-    xfree(buffers);
+    free(buffers[0].driverPrivate);
+    free(buffers);
 }
 #else
 static void
@@ -221,8 +221,8 @@
     priv = buffers->driverPrivate;
     (*pScreen->DestroyPixmap)(priv->pixmap);
 
-    xfree(buffers->driverPrivate);
-    xfree(buffers);
+    free(buffers->driverPrivate);
+    free(buffers);
 }
 #endif
 
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-drm.c
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm-drm.c	2011-08-02 13:37:04.000000000 +0000
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-drm.c	2011-08-02 13:50:50.000000000 +0000
@@ -156,7 +156,7 @@
     if (ret)
 	return NULL;
 
-    bo = xcalloc(1, sizeof(struct msm_drm_bo));
+    bo = calloc(1, sizeof(struct msm_drm_bo));
 
     if (bo == NULL)
 	return NULL;
@@ -322,6 +322,6 @@
     close.handle = bo->handle;
     ret = ioctl(bo->fd, DRM_IOCTL_GEM_CLOSE, &close);
 
-    xfree(bo);
+    free(bo);
 }
 
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-exa.c
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm-exa.c	2011-08-02 13:37:04.000000000 +0000
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-exa.c	2011-08-02 13:51:04.000000000 +0000
@@ -679,7 +679,7 @@
     ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
     MSMPtr pMsm = MSMPTR(pScrn);
 
-    priv = xcalloc(1, sizeof(struct msm_pixmap_priv));
+    priv = calloc(1, sizeof(struct msm_pixmap_priv));
     if (priv == NULL)
 	return NULL;
 
@@ -692,7 +692,7 @@
     if (priv->bo)
 	return priv;
 
-    xfree(priv);
+    free(priv);
     return NULL;
 }
 
@@ -707,7 +707,7 @@
     if (priv->bo)
 	msm_drm_bo_free(priv->bo);
 
-    xfree(dpriv);
+    free(dpriv);
 }
 
 Bool
Index: xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-pixmap.c
===================================================================
--- xf86-video-msm-1.0.1+git20100122.5f7df591.orig/src/msm-pixmap.c	2011-08-02 13:37:04.000000000 +0000
+++ xf86-video-msm-1.0.1+git20100122.5f7df591/src/msm-pixmap.c	2011-08-02 13:51:22.000000000 +0000
@@ -107,7 +107,7 @@
     ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
     MSMPtr pMsm = MSMPTR(pScrn);
     struct msm_offscreen_area *ret =
-	xcalloc(1, sizeof(struct msm_offscreen_area));
+	calloc(1, sizeof(struct msm_offscreen_area));
 
     if (ret == NULL)
 	return NULL;
@@ -148,7 +148,7 @@
     }
 
 err:
-    xfree(ret);
+    free(ret);
     return NULL;
 }
 
@@ -163,7 +163,7 @@
     else if (area->type == MSM_OFFSCREEN_EXA)
 	exaOffscreenFree(pScreen, (ExaOffscreenArea *) area->priv);
 
-    xfree(area);
+    free(area);
 }