From: Dan Carpenter Date: Wed, 28 Jan 2015 19:15:31 +0000 (+0300) Subject: regulator: qcom-rpm: signedness bug in probe() X-Git-Tag: v4.14-rc1~6022^2~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a412ec27957c9dc216b19d638c808d7ddfa2debd;p=platform%2Fkernel%2Flinux-rpi.git 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; }