From: Lee Jones Date: Fri, 26 Jun 2020 06:57:36 +0000 (+0100) Subject: regulator: tps65218-regulator: Remove pointless 'is unsigned int <0' check X-Git-Tag: v5.10.7~1600^2~46 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02d88863198c48675ceb2a244e5985c5650e5fe6;p=platform%2Fkernel%2Flinux-rpi.git regulator: tps65218-regulator: Remove pointless 'is unsigned int <0' check 'rid' is declared as unsigned int, so there is little point checking for <0. Removing these checks fixes the following W=1 warnings: drivers/regulator/tps65218-regulator.c: In function ‘tps65218_pmic_set_suspend_enable’: drivers/regulator/tps65218-regulator.c:131:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 131 | if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) | ^ drivers/regulator/tps65218-regulator.c: In function ‘tps65218_pmic_set_suspend_disable’: drivers/regulator/tps65218-regulator.c:144:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 144 | if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) | ^ Signed-off-by: Lee Jones Cc: Keerthy Cc: Tero Kristo Cc: Dave Gerlach Cc: linux-omap@vger.kernel.org Link: https://lore.kernel.org/r/20200626065738.93412-8-lee.jones@linaro.org Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c index 05d13f8..9133d0af 100644 --- a/drivers/regulator/tps65218-regulator.c +++ b/drivers/regulator/tps65218-regulator.c @@ -128,7 +128,7 @@ static int tps65218_pmic_set_suspend_enable(struct regulator_dev *dev) struct tps65218 *tps = rdev_get_drvdata(dev); unsigned int rid = rdev_get_id(dev); - if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) + if (rid > TPS65218_LDO_1) return -EINVAL; return tps65218_clear_bits(tps, dev->desc->bypass_reg, @@ -141,7 +141,7 @@ static int tps65218_pmic_set_suspend_disable(struct regulator_dev *dev) struct tps65218 *tps = rdev_get_drvdata(dev); unsigned int rid = rdev_get_id(dev); - if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) + if (rid > TPS65218_LDO_1) return -EINVAL; /*