All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] regulator: qcom-rpm: signedness bug in probe()
@ 2015-01-28 19:15 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-01-28 19:15 UTC (permalink / raw)
  To: Liam Girdwood, Bjorn Andersson; +Cc: Mark Brown, linux-kernel, kernel-janitors

"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>

diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers/regulator/qcom_rpm-regulator.c
index edd0a17..ec540aa 100644
--- a/drivers/regulator/qcom_rpm-regulator.c
+++ b/drivers/regulator/qcom_rpm-regulator.c
@@ -769,7 +769,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;
 		}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-29  2:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-28 19:15 [patch] regulator: qcom-rpm: signedness bug in probe() Dan Carpenter
2015-01-28 19:15 ` Dan Carpenter
2015-01-28 19:43 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.