From: Dan Carpenter Date: Wed, 28 Jan 2015 19:15:31 +0000 (+0300) Subject: regulator: qcom-rpm: signedness bug in probe() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a412ec27957c9dc216b19d638c808d7ddfa2debd;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.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 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; }