From a412ec27957c9dc216b19d638c808d7ddfa2debd Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 28 Jan 2015 22:15:31 +0300 Subject: 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 Signed-off-by: Mark Brown diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers/regulator/qcom_rpm-regulator.c index 8364ff3..3ab65c6 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; } -- cgit v0.10.2