On Wed, 2008-11-26 at 01:39 -0500, Andres Salomon wrote: > There are a number of minor issues w/ I830GetRec: > - pI830 is local, and therefore never gets used > - it only ever returns TRUE (no need to check the result) > - it's only ever called once, so there's not much point in protecting > against multple calls > > So, this drops I830GetRec and instead just calls xnfcalloc directly. Since > xnfcalloc will never fail, there's no point in checking the result.
Does this result in a leak for server regen?
> Signed-off-by: Andres Salomon <[EMAIL PROTECTED]>
> ---
> src/i830_driver.c | 16 +---------------
> 1 files changed, 1 insertions(+), 15 deletions(-)
>
> diff --git a/src/i830_driver.c b/src/i830_driver.c
> index 1407a22..a24c8da 100644
> --- a/src/i830_driver.c
> +++ b/src/i830_driver.c
> @@ -402,17 +402,6 @@ I830AvailableOptions(int chipid, int busid)
> return NULL;
> }
>
> -static Bool
> -I830GetRec(ScrnInfoPtr pScrn)
> -{
> - I830Ptr pI830;
> -
> - if (pScrn->driverPrivate)
> - return TRUE;
> - pI830 = pScrn->driverPrivate = xnfcalloc(sizeof(I830Rec), 1);
> - return TRUE;
> -}
> -
> static void
> I830FreeRec(ScrnInfoPtr pScrn)
> {
> @@ -1755,11 +1744,8 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
> if (flags & PROBE_DETECT)
> return TRUE;
>
> - /* Allocate driverPrivate */
> - if (!I830GetRec(pScrn))
> - return FALSE;
> + pI830 = pScrn->driverPrivate = xnfcalloc(sizeof(I830Rec), 1);
>
> - pI830 = I830PTR(pScrn);
> pI830->SaveGeneration = -1;
> pI830->pEnt = pEnt;
> pI830->use_drm_mode = drm_mode_setting;
--
Eric Anholt
[EMAIL PROTECTED] [EMAIL PROTECTED]
signature.asc
Description: This is a digitally signed message part
_______________________________________________ xorg mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/xorg
