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 <[EMAIL PROTECTED]> --- 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 _______________________________________________ xorg mailing list xorg@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/xorg