pass: resmon: Save updated timer interval 60/174360/1
authorChanwoo Choi <cw00.choi@samsung.com>
Fri, 30 Mar 2018 06:52:57 +0000 (15:52 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 30 Mar 2018 08:29:45 +0000 (17:29 +0900)
RESMON provides the update function of 'timer interval' on the runtime.
Should save the updated 'timer interval' value to 'struct resmon'.

Change-Id: Ice3deb34889343dfbcb555cb31fcfff37d6cf2a6
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/pass/pass-resmon.c

index f1c85aa6366f1968d6e1eeb0fe99d73947947650..9736870f474fff392283cf60885b49557621f339 100644 (file)
@@ -150,6 +150,8 @@ static int resmon_timer_add(struct resmon *monitor, unsigned int interval)
                return -EPERM;
        }
 
+       monitor->timer_interval = interval;
+
        return 0;
 }
 
@@ -368,6 +370,9 @@ int pass_resmon_update_timer_interval(struct pass_resource *res,
                return -EINVAL;
        }
 
+       if (monitor->timer_interval == timer_interval)
+               return 0;
+
        /* Update new interval of timer-based resmon */
        ret = resmon_timer_add(monitor, timer_interval);
        if (ret < 0)