linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pwm: imx: Signedness bug in imx_pwm_get_state()
@ 2019-01-09  8:27 Dan Carpenter
  2019-01-10 10:18 ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2019-01-09  8:27 UTC (permalink / raw)
  To: Thierry Reding, Anson Huang; +Cc: linux-pwm, kernel-janitors

"ret" only holds zero and negative error codes.  It needs to be signed
for the error handling to work.

Fixes: 9f4c8f9607c3 ("pwm: imx: Add ipg clock operation")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/pwm/pwm-imx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
index 55a3a363d5be..b8452abe2392 100644
--- a/drivers/pwm/pwm-imx.c
+++ b/drivers/pwm/pwm-imx.c
@@ -128,8 +128,9 @@ static void imx_pwm_get_state(struct pwm_chip *chip,
 		struct pwm_device *pwm, struct pwm_state *state)
 {
 	struct imx_chip *imx = to_imx_chip(chip);
-	u32 period, prescaler, pwm_clk, ret, val;
+	u32 period, prescaler, pwm_clk, val;
 	u64 tmp;
+	int ret;
 
 	ret = imx_pwm_clk_prepare_enable(chip);
 	if (ret < 0)
-- 
2.17.1

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

end of thread, other threads:[~2019-01-10 11:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-09  8:27 [PATCH] pwm: imx: Signedness bug in imx_pwm_get_state() Dan Carpenter
2019-01-10 10:18 ` Uwe Kleine-König
2019-01-10 11:08   ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).