[PATCH] randr: fix return types and double assignment in randr code.

Dave Airlie airlied at gmail.com
Mon Aug 22 07:46:30 PDT 2011


From: Dave Airlie <airlied at redhat.com>

returning NULL is probably a lot better plan, also we don't need to assign
pScreen twice in the crtc code.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 randr/rrcrtc.c   |    3 +--
 randr/rroutput.c |    2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 0437795..723640a 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -71,7 +71,7 @@ RRCrtcCreate (ScreenPtr pScreen, void *devPrivate)
     else
 	crtcs = malloc(sizeof (RRCrtcPtr));
     if (!crtcs)
-	return FALSE;
+	return NULL;
     pScrPriv->crtcs = crtcs;
     
     crtc = calloc(1, sizeof (RRCrtcRec));
@@ -100,7 +100,6 @@ RRCrtcCreate (ScreenPtr pScreen, void *devPrivate)
 	return NULL;
 
     /* attach the screen and crtc together */
-    crtc->pScreen = pScreen;
     pScrPriv->crtcs[pScrPriv->numCrtcs++] = crtc;
     
     return crtc;
diff --git a/randr/rroutput.c b/randr/rroutput.c
index 5edeb7d..2b52537 100644
--- a/randr/rroutput.c
+++ b/randr/rroutput.c
@@ -68,7 +68,7 @@ RROutputCreate (ScreenPtr   pScreen,
     else
 	outputs = malloc(sizeof (RROutputPtr));
     if (!outputs)
-	return FALSE;
+	return NULL;
 
     pScrPriv->outputs = outputs;
     
-- 
1.7.6



More information about the xorg-devel mailing list