OSDN Git Service

IRDA-1184: Fix poll time calculation routine
authorPatrick Porlan <patrick.porlan@intel.com>
Mon, 29 Sep 2014 15:26:00 +0000 (17:26 +0200)
committerAdriana Reus <adriana.reus@intel.com>
Wed, 1 Oct 2014 11:22:08 +0000 (14:22 +0300)
The poll delay should be maximum if we're operating in continuous mode
even if the sensor supports a motion trigger. This should very slightly
lower CPU consumption, avoiding a few unrequired exits from epoll.

Issue: IRDA-1184

Change-Id: I026be3de5fed49b77f7d9ac3718ab7c71e527d9d
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
control.c

index 87db17c..db8d324 100644 (file)
--- a/control.c
+++ b/control.c
@@ -983,10 +983,9 @@ static int get_poll_wait_timeout (void)
         */
        for (s=0; s<sensor_count; s++)
                if (sensor_info[s].enable_count &&
-                   ((sensor_info[s].quirks & QUIRK_TERSE_DRIVER) ||
-                     sensor_info[s].selected_trigger ==
-                     sensor_info[s].motion_trigger_name) &&
-                    sensor_info[s].sampling_rate) {
+                   sensor_info[s].selected_trigger ==
+                   sensor_info[s].motion_trigger_name &&
+                   sensor_info[s].sampling_rate) {
                        period = (int64_t) (1000000000.0 /
                                                sensor_info[s].sampling_rate);