[PATCH 1/2] xf86-video-intel: i830_driver: drop I830GetRec

Andres Salomon dilinger at queued.net
Thu Dec 11 04:19:33 PST 2008


On Wed, 10 Dec 2008 23:45:22 -0800
Eric Anholt <eric at anholt.net> wrote:

> 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?

AFAICT, PreInit is only ever called from InitOutput(), when PROBE_DETECT
is unset and serverGeneration==1.  So, unless I'm misunderstanding your
question, it should only be called once (and skipped in the regen path).


While looking at this, I noticed that we don't use the preinit variable
at all..

Signed-off-by: Andres Salomon <dilinger at debian.org>
---
 src/i830.h        |    1 -
 src/i830_driver.c |    4 ----
 2 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/src/i830.h b/src/i830.h
index 8ad5c69..83c9872 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -625,7 +625,6 @@ typedef struct _I830Rec {
    Bool StolenOnly;
 
    /* Driver phase/state information */
-   Bool preinit;
    Bool starting;
    Bool closing;
    Bool suspended;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 7590257..fa9cdab 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1856,8 +1856,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
 
    pI830->cpp = pScrn->bitsPerPixel / 8;
 
-   pI830->preinit = TRUE;
-
    if (!I830GetEarlyOptions(pScrn))
        return FALSE;
 
@@ -2000,8 +1998,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
    }
 #endif
 
-   pI830->preinit = FALSE;
-
    return TRUE;
 }
 
-- 
1.5.6.5




More information about the xorg mailing list