[PATCH] regulator: tps62360: Remove pointless test for unsignedless than zero

From: Axel Lin
Date: Mon Feb 06 2012 - 22:06:32 EST


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

Signed-off-by: Axel Lin <axel.lin@xxxxxxxxx>
---
drivers/regulator/tps62360-regulator.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/tps62360-regulator.c b/drivers/regulator/tps62360-regulator.c
index f778ef0..e2ec730 100644
--- a/drivers/regulator/tps62360-regulator.c
+++ b/drivers/regulator/tps62360-regulator.c
@@ -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;
}
--
1.7.5.4



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/