[PATCH 2/2] xf86-video-intel: i810_driver: drop I810GetRec

Andres Salomon dilinger at queued.net
Tue Nov 25 22:40:04 PST 2008


There aren't as many issues with I810GetRec, but there's not much point
for its existence, either.  Since it's only ever called once, drop it
and simply call xnfcalloc directly.  Since xnfcalloc will never fail,
there's no point in checking the result.

Signed-off-by: Andres Salomon <dilinger at debian.org>
---
 src/i810_driver.c |   20 +++-----------------
 1 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/src/i810_driver.c b/src/i810_driver.c
index cc28ad8..20d1fe1 100644
--- a/src/i810_driver.c
+++ b/src/i810_driver.c
@@ -528,22 +528,12 @@ i810Setup(pointer module, pointer opts, int *errmaj, int *errmin)
 
 #ifndef I830_ONLY
 /*
- * I810GetRec and I810FreeRec --
+ * I810FreeRec --
  *
  * Private data for the driver is stored in the screen structure.
- * These two functions create and destroy that private data.
+ * This function destroys that private data.
  *
  */
-static Bool
-I810GetRec(ScrnInfoPtr pScrn)
-{
-   if (pScrn->driverPrivate)
-      return TRUE;
-
-   pScrn->driverPrivate = xnfcalloc(sizeof(I810Rec), 1);
-   return TRUE;
-}
-
 static void
 I810FreeRec(ScrnInfoPtr pScrn)
 {
@@ -921,11 +911,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
    if (pScrn->numEntities != 1)
       return FALSE;
 
-   /* Allocate driverPrivate */
-   if (!I810GetRec(pScrn))
-      return FALSE;
-
-   pI810 = I810PTR(pScrn);
+   pI810 = pScrn->driverPrivate = xnfcalloc(sizeof(I810Rec), 1);
 
    pI810->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
    if (pI810->pEnt->location.type != BUS_PCI)
-- 
1.5.6.5




More information about the xorg mailing list