@@ -104,7 +104,7 @@ static int update_resource_level(struct shared_resource *resp)
{
struct users_list *user;
unsigned long target_level;
- int ret;
+ int ret = 0;
mutex_lock(&resp->resource_mutex);
/* Regenerate the target_value for the resource */
@@ -125,6 +125,9 @@ static int update_resource_level(struct shared_resource *resp)
}
mutex_unlock(&resp->resource_mutex);
+ if (resp->curr_level == target_level)
+ return ret;
+
pr_debug("SRF: Changing Level for resource %s to %ld\n",
resp->name, target_level);
ret = resp->ops->change_level(resp, target_level);