]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
regulator: qcom-rpm: signedness bug in probe()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 28 Jan 2015 19:15:31 +0000 (22:15 +0300)
committerMark Brown <broonie@kernel.org>
Wed, 28 Jan 2015 19:43:43 +0000 (19:43 +0000)
"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>
drivers/regulator/qcom_rpm-regulator.c

index 8364ff331a81838c6e84fe822b17d434bfb74aa7..3ab65c62fdd534ba94a98db7dc4274888fd0ba75 100644 (file)
@@ -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;
                }