* [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* Re: [PATCH] pwm: imx: Signedness bug in imx_pwm_get_state()
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
0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2019-01-10 10:18 UTC (permalink / raw)
To: Dan Carpenter, Thierry Reding; +Cc: Anson Huang, linux-pwm, kernel-janitors
On Wed, Jan 09, 2019 at 11:27:47AM +0300, Dan Carpenter wrote:
> "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>
I would have expected a compiler warning but at least for me there is
none emitted. Hmm.
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
@Thierry: Given that this is a fix I assume you want to apply this patch
before my pwm-imx series (which is cleanup only). This will conflict for
sure with my driver splitting patch. Please tell me if/when I should
resend my series rebased on top of this patch.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] pwm: imx: Signedness bug in imx_pwm_get_state()
2019-01-10 10:18 ` Uwe Kleine-König
@ 2019-01-10 11:08 ` Thierry Reding
0 siblings, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2019-01-10 11:08 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Dan Carpenter, Anson Huang, linux-pwm, kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 908 bytes --]
On Thu, Jan 10, 2019 at 11:18:18AM +0100, Uwe Kleine-König wrote:
> On Wed, Jan 09, 2019 at 11:27:47AM +0300, Dan Carpenter wrote:
> > "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>
>
> I would have expected a compiler warning but at least for me there is
> none emitted. Hmm.
>
> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> @Thierry: Given that this is a fix I assume you want to apply this patch
> before my pwm-imx series (which is cleanup only). This will conflict for
> sure with my driver splitting patch. Please tell me if/when I should
> resend my series rebased on top of this patch.
It's fine, I manually applied this on top of the driver split patch.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [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).