Skip to content

Commit

Permalink
regulator: tps62360: Remove pointless test for unsigned less than zero
Browse files Browse the repository at this point in the history
The variable 'selector' is a 'unsigned int', so it can never be less than zero.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Mar 11, 2012
1 parent 22cd2fe commit 46783a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/tps62360-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 46783a0

Please sign in to comment.