[PATCH driver/vesa] Make bool option parsing clearer and more consistent

Egbert Eich eich at freedesktop.org
Wed Jul 31 08:28:32 PDT 2013


When there's no need to know whether the user has set the value
of a configurable option (for logging for instance) the return
of xf86ReturnOptValBool() can be assigned directly.

Suggested-By: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Egbert Eich <eich at freedesktop.org>
---
 src/vesa.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/vesa.c b/src/vesa.c
index 40fb408..99366f6 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -838,8 +838,8 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pVesa->Options);
 
     /* Use shadow by default */
-    if (xf86ReturnOptValBool(pVesa->Options, OPTION_SHADOW_FB, TRUE)) 
-	pVesa->shadowFB = TRUE;
+    pVesa->shadowFB = xf86ReturnOptValBool(pVesa->Options, OPTION_SHADOW_FB,
+					   TRUE);
 
     /*
      * Use default refresh by default. Too manu VBE 3.0
@@ -848,10 +848,9 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
     pVesa->defaultRefresh = xf86ReturnOptValBool(pVesa->Options,
 						 OPTION_DFLT_REFRESH, TRUE);
 
-    pVesa->ModeSetClearScreen = FALSE;
-    if (xf86ReturnOptValBool(pVesa->Options, OPTION_MODESET_CLEAR_SCREEN, 
-			     FALSE))
-	pVesa->ModeSetClearScreen = TRUE;
+    pVesa->ModeSetClearScreen =
+	    xf86ReturnOptValBool(pVesa->Options,
+				 OPTION_MODESET_CLEAR_SCREEN, FALSE);
 
     if (!pVesa->defaultRefresh && !pVesa->strict_validation)
 	VBESetModeParameters(pScrn, pVesa->pVbe);
-- 
1.8.1.4



More information about the xorg-devel mailing list