mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
regulator: vctrl: Use min() instead of doing it manually
Fix following coccicheck warning: drivers/regulator/vctrl-regulator.c:188:15-17: WARNING opportunity for max() Signed-off-by: Haowen Bai <baihaowen@meizu.com> Link: https://lore.kernel.org/r/1647315190-16139-1-git-send-email-baihaowen@meizu.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
760423dfad
commit
8a317e0079
@ -185,10 +185,7 @@ static int vctrl_set_voltage_sel(struct regulator_dev *rdev,
|
||||
unsigned int next_sel;
|
||||
int delay;
|
||||
|
||||
if (selector >= vctrl->vtable[vctrl->sel].ovp_min_sel)
|
||||
next_sel = selector;
|
||||
else
|
||||
next_sel = vctrl->vtable[vctrl->sel].ovp_min_sel;
|
||||
next_sel = max_t(unsigned int, selector, vctrl->vtable[vctrl->sel].ovp_min_sel);
|
||||
|
||||
ret = regulator_set_voltage_rdev(rdev->supply->rdev,
|
||||
vctrl->vtable[next_sel].ctrl,
|
||||
|
Loading…
Reference in New Issue
Block a user