From 8bdadac13f65c14d7b6df711793eb31ba9db296e Mon Sep 17 00:00:00 2001 From: Rajkumar Manoharan Date: Tue, 13 Jan 2015 14:52:14 +0530 Subject: [PATCH] ath10k: fix duration calculation for quiet param 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 Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/thermal.c b/drivers/net/wireless/ath/ath10k/thermal.c index c384c79975ba..41cff50baa41 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, -- 2.34.1