[PATCH xserver 2/2] xfree86: allow to check for percent options without warnings in the log

Simon Thum simon.thum at gmx.de
Mon Feb 7 14:28:49 PST 2011


This allows set_percent_option() in synaptics to work as described, i.e.
without an irritating warning.

Signed-off-by: Simon Thum <simon.thum at gmx.de>
---
Possibly, the other cases should be aligned as well?

 hw/xfree86/common/xf86Option.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c
index 455cafa..9ab183b 100644
--- a/hw/xfree86/common/xf86Option.c
+++ b/hw/xfree86/common/xf86Option.c
@@ -561,8 +561,10 @@ ParseOptionValue(int scrnIndex, pointer options,
OptionInfoPtr p,
 		 * hence 100 looks the same as 100% to the caller of sccanf
 		 */
 		if (sscanf(s, "%lf%c", &p->value.realnum, &tmp) != 2 || tmp != '%') {
-		    xf86DrvMsg(scrnIndex, X_WARNING,
+		    if (markUsed) {
+			xf86DrvMsg(scrnIndex, X_WARNING,
 			       "Option \"%s\" requires a percent value\n", p->name);
+		    }
 		    p->found = FALSE;
 		} else {
 		    p->found = TRUE;
-- 
1.7.3.4



More information about the xorg-devel mailing list