summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-01-28 22:15:31 +0300
committerMark Brown <broonie@kernel.org>2015-01-28 19:43:43 +0000
commita412ec27957c9dc216b19d638c808d7ddfa2debd (patch)
tree55550b9e75530de0608f10a959767c508d9ee0b6
parent97bf6af1f928216fd6c5a66e8a57bfa95a659672 (diff)
downloadlinux-a412ec27957c9dc216b19d638c808d7ddfa2debd.tar.gz
linux-a412ec27957c9dc216b19d638c808d7ddfa2debd.tar.bz2
linux-a412ec27957c9dc216b19d638c808d7ddfa2debd.zip
regulator: qcom-rpm: signedness bug in probe()
"force_mode" is a u32 so it is never "< 0", but because of type promotion then comparing "== -1" will do what we want. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/regulator/qcom_rpm-regulator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers/regulator/qcom_rpm-regulator.c
index 8364ff331a81..3ab65c62fdd5 100644
--- a/drivers/regulator/qcom_rpm-regulator.c
+++ b/drivers/regulator/qcom_rpm-regulator.c
@@ -768,7 +768,7 @@ static int rpm_reg_probe(struct platform_device *pdev)
break;
}
- if (force_mode < 0) {
+ if (force_mode == -1) {
dev_err(&pdev->dev, "invalid force mode\n");
return -EINVAL;
}