summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-10-25 11:49:26 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-10-31 09:39:04 +1000
commit63e87b8639eb8e0b4e32e5d3a09099d31a03bbcd (patch)
tree9b6ea43394c19c87e8bc44f90b14622b61ef27c0
parent005ab41986b0bb6a4e626aee7a7a542247f422e7 (diff)
xfree86: reduce calls to input_option_get_key/value
No functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
-rw-r--r--hw/xfree86/common/xf86Xinput.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 425b35957..ee705a4a8 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -910,35 +910,38 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs,
return BadAlloc;
nt_list_for_each_entry(option, options, list.next) {
- if (strcasecmp(input_option_get_key(option), "driver") == 0) {
+ const char *key = input_option_get_key(option);
+ const char *value = input_option_get_value(option);
+
+ if (strcasecmp(key, "driver") == 0) {
if (pInfo->driver) {
rval = BadRequest;
goto unwind;
}
- pInfo->driver = xstrdup(input_option_get_value(option));
+ pInfo->driver = xstrdup(value);
if (!pInfo->driver) {
rval = BadAlloc;
goto unwind;
}
}
- if (strcasecmp(input_option_get_key(option), "name") == 0 ||
- strcasecmp(input_option_get_key(option), "identifier") == 0) {
+ if (strcasecmp(key, "name") == 0 ||
+ strcasecmp(key, "identifier") == 0) {
if (pInfo->name) {
rval = BadRequest;
goto unwind;
}
- pInfo->name = xstrdup(input_option_get_value(option));
+ pInfo->name = xstrdup(value);
if (!pInfo->name) {
rval = BadAlloc;
goto unwind;
}
}
- if (strcmp(input_option_get_key(option), "_source") == 0 &&
- (strcmp(input_option_get_value(option), "server/hal") == 0 ||
- strcmp(input_option_get_value(option), "server/udev") == 0 ||
- strcmp(input_option_get_value(option), "server/wscons") == 0)) {
+ if (strcmp(key, "_source") == 0 &&
+ (strcmp(value, "server/hal") == 0 ||
+ strcmp(value, "server/udev") == 0 ||
+ strcmp(value, "server/wscons") == 0)) {
is_auto = 1;
if (!xf86Info.autoAddDevices) {
rval = BadMatch;