Skip to contentSkip to conversation

regulator: tps62360: Remove pointless test for unsigned less than zero

PATCH Applied Axel Lin 3 participants 3 messages Feb 7, 2012 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: tps62360: Remove pointless test for unsigned less than zero

The variable 'selector' is a 'unsigned int', so it can never be less than zero.

---
 drivers/regulator/tps62360-regulator.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/regulator/tps62360-regulator.c +1 -1
index f778ef0..e2ec730 100644
@@ -191,7 +191,7 @@ static int tps62360_dcdc_list_voltage(struct regulator_dev *dev,
 {
 	struct tps62360_chip *tps = rdev_get_drvdata(dev);
 
-	if ((selector < 0) || (selector >= tps->desc.n_voltages))
+	if (selector >= tps->desc.n_voltages)
 		return -EINVAL;
 	return (tps->voltage_base + selector * 10) * 1000;
 }
Signature · 1 line
1.7.5.4
Applied
#2 lore raw
In reply to Axel Lin
Quoted 1 line · Axel Lin

The variable 'selector' is a 'unsigned int', so it can never be less than zero.

Applied, thanks.