diff mbox

ath10k: fix duration calculation for quiet param

Message ID 1421140934-16109-1-git-send-email-rmanohar@qti.qualcomm.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Rajkumar Manoharan Jan. 13, 2015, 9:22 a.m. UTC
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>
---
 drivers/net/wireless/ath/ath10k/thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo Jan. 15, 2015, 10:34 a.m. UTC | #1
Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes:

> 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>

Thanks, applied.
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/thermal.c b/drivers/net/wireless/ath/ath10k/thermal.c
index edecc6c..aede750 100644
--- a/drivers/net/wireless/ath/ath10k/thermal.c
+++ b/drivers/net/wireless/ath/ath10k/thermal.c
@@ -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,