cpuquiet: Update stats only on successful operations
Sai Charan Gurrappadi [Thu, 14 Jun 2012 21:17:14 +0000 (14:17 -0700)]
Change-Id: I0584fba7458b3a860f9ab3751a8eb5f0345864ad
Signed-off-by: Sai Charan Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/111285
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

drivers/cpuquiet/driver.c

index f9dcdf0..d9dbea7 100644 (file)
@@ -78,7 +78,8 @@ int cpuquiet_quiesence_cpu(unsigned int cpunumber)
        if (cpuquiet_curr_driver && cpuquiet_curr_driver->quiesence_cpu)
                err = cpuquiet_curr_driver->quiesence_cpu(cpunumber);
 
-       stats_update(stats + cpunumber, 0);
+       if (!err)
+               stats_update(stats + cpunumber, 0);
 
        return err;
 }
@@ -91,7 +92,8 @@ int cpuquiet_wake_cpu(unsigned int cpunumber)
        if (cpuquiet_curr_driver && cpuquiet_curr_driver->wake_cpu)
                err = cpuquiet_curr_driver->wake_cpu(cpunumber);
 
-       stats_update(stats + cpunumber, 1);
+       if (!err)
+               stats_update(stats + cpunumber, 1);
 
        return err;
 }