On 2/6/2025 2:09 AM, Bart Van Assche wrote:
On 2/3/25 12:11 AM, Ziqi Chen wrote:
- /* Enable Write Booster if we have scaled up else disable it */
- if (ufshcd_enable_wb_if_scaling_up(hba) && !err)
- ufshcd_wb_toggle(hba, scale_up);
+ /* Enable Write Booster if current gear requires it else disable
it */
+ if (ufshcd_enable_wb_if_scaling_up(hba) && !err) {
+ bool wb_en = false;
+
+ wb_en = hba->pwr_info.gear_rx >= hba->clk_scaling.wb_gear ?
true : false;
+ ufshcd_wb_toggle(hba, wb_en);
+ }
Both the " = false" initialization and the "? true : false" part are
unnecessary. Please remove the "wb_en" variable entirely, e.g. as follows:
if (ufshcd_enable_wb_if_scaling_up(hba) && !err)
ufshcd_wb_toggle(hba, hba->pwr_info.gear_rx >=
hba->clk_scaling.wb_gear);
Otherwise this patch looks good to me.
Thanks,
Bart.
Sure , Bart. Your suggestion looks nice. let me apply it in next
version, thank you~
-Ziqi