Skip to contentSkip to conversation

regulator: vctrl: Remove unneeded continue statement

PATCH In review Axel Lin 3 participants 3 messages Mar 29, 2019 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: vctrl: Remove unneeded continue statement

---
 drivers/regulator/vctrl-regulator.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/regulator/vctrl-regulator.c +1 -3
index 78de002037c7..259864520a06 100644
@@ -334,10 +334,8 @@ static int vctrl_init_vtable(struct platform_device *pdev)
 		ctrl_uV = regulator_list_voltage(ctrl_reg, i);
 
 		if (ctrl_uV < vrange_ctrl->min_uV ||
-		    ctrl_uV > vrange_ctrl->max_uV) {
+		    ctrl_uV > vrange_ctrl->max_uV)
 			rdesc->n_voltages--;
-			continue;
-		}
 	}
 
 	if (rdesc->n_voltages == 0) {
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Axel Lin

Yeah indeed! but where is commit text atleast a one-liner.

Otherwise looks good to me.

Cheers,
-Mukesh

Quoted 20 lines
---
  drivers/regulator/vctrl-regulator.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/regulator/vctrl-regulator.c +1 -3
index 78de002037c7..259864520a06 100644
@@ -334,10 +334,8 @@ static int vctrl_init_vtable(struct platform_device *pdev)
  		ctrl_uV = regulator_list_voltage(ctrl_reg, i);
 
  		if (ctrl_uV < vrange_ctrl->min_uV ||
-		    ctrl_uV > vrange_ctrl->max_uV) {
+		    ctrl_uV > vrange_ctrl->max_uV)
  			rdesc->n_voltages--;
-			continue;
-		}
  	}
 
  	if (rdesc->n_voltages == 0) {
Reviewed-by on v1 1/1
#2 lore raw
In reply to Axel Lin

Hi Axel,

On Fri, Mar 29, 2019 at 09:46:31AM +0800, Axel Lin wrote:

As Mukesh already mentioned, there should be a short description.

Quoted 10 lines
---
 drivers/regulator/vctrl-regulator.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/regulator/vctrl-regulator.c +0 -0
index 78de002037c7..259864520a06 100644

drivers/regulator/vctrl-regulator.c static int vctrl_init_vtable(struct platform_device *pdev) · line 340

Quoted 8 lines
drivers/regulator/vctrl-regulator.c +1 -3
@@ -334,10 +334,8 @@ static int vctrl_init_vtable(struct platform_device *pdev)
 		ctrl_uV = regulator_list_voltage(ctrl_reg, i);
 
 		if (ctrl_uV < vrange_ctrl->min_uV ||
-		    ctrl_uV > vrange_ctrl->max_uV) {
+		    ctrl_uV > vrange_ctrl->max_uV)
 			rdesc->n_voltages--;
-			continue;
-		}

indeed, the 'continue' is pointless here. I guess at some stage of development something else was done in the loop and this is a leftover.