ath10k: fix duration calculation for quiet param
authorRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Tue, 13 Jan 2015 09:22:14 +0000 (14:52 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 15 Jan 2015 10:33:42 +0000 (12:33 +0200)
The duty cycle (% of quiet duration) is used to put the device
in quiet mode for the given period. Currently the quiet duration
is wrongly calculated which results in not enabling quiet mode.
Fix the calculation as below

     duration = (period * duty cycle) / 100

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/thermal.c

index c384c79975ba668f825ca899b2602f9224918312..41cff50baa413478811bbfd3e7708e560d0ee843 100644 (file)
@@ -98,7 +98,7 @@ static int ath10k_thermal_set_cur_dutycycle(struct thermal_cooling_device *cdev,
        }
        period = max(ATH10K_QUIET_PERIOD_MIN,
                     (ATH10K_QUIET_PERIOD_DEFAULT / num_bss));
-       duration = period * (duty_cycle / 100);
+       duration = (period * duty_cycle) / 100;
        enabled = duration ? 1 : 0;
 
        ret = ath10k_wmi_pdev_set_quiet_mode(ar, period, duration,