public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Input: nomadik-ske-keypad - Fix a loop timeout test
@ 2018-12-18  8:18 Dan Carpenter
  2018-12-21  8:40 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-12-18  8:18 UTC (permalink / raw)
  To: kernel-janitors

The loop exits with "timeout" set to -1 not to 0.

Fixes: 1158f0f16224 ("Input: add support for Nomadik SKE keypad controller")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/input/keyboard/nomadik-ske-keypad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c
index 8567ee47761e..ae3b04557074 100644
--- a/drivers/input/keyboard/nomadik-ske-keypad.c
+++ b/drivers/input/keyboard/nomadik-ske-keypad.c
@@ -100,7 +100,7 @@ static int __init ske_keypad_chip_init(struct ske_keypad *keypad)
 	while ((readl(keypad->reg_base + SKE_RIS) != 0x00000000) && timeout--)
 		cpu_relax();
 
-	if (!timeout)
+	if (timeout = -1)
 		return -EINVAL;
 
 	/*
-- 
2.17.1

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

* Re: [PATCH] Input: nomadik-ske-keypad - Fix a loop timeout test
  2018-12-18  8:18 [PATCH] Input: nomadik-ske-keypad - Fix a loop timeout test Dan Carpenter
@ 2018-12-21  8:40 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2018-12-21  8:40 UTC (permalink / raw)
  To: kernel-janitors

On Tue, Dec 18, 2018 at 11:18:54AM +0300, Dan Carpenter wrote:
> The loop exits with "timeout" set to -1 not to 0.
> 
> Fixes: 1158f0f16224 ("Input: add support for Nomadik SKE keypad controller")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thank you.

> ---
>  drivers/input/keyboard/nomadik-ske-keypad.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c
> index 8567ee47761e..ae3b04557074 100644
> --- a/drivers/input/keyboard/nomadik-ske-keypad.c
> +++ b/drivers/input/keyboard/nomadik-ske-keypad.c
> @@ -100,7 +100,7 @@ static int __init ske_keypad_chip_init(struct ske_keypad *keypad)
>  	while ((readl(keypad->reg_base + SKE_RIS) != 0x00000000) && timeout--)
>  		cpu_relax();
>  
> -	if (!timeout)
> +	if (timeout = -1)
>  		return -EINVAL;
>  
>  	/*
> -- 
> 2.17.1
> 

-- 
Dmitry

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

end of thread, other threads:[~2018-12-21  8:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-18  8:18 [PATCH] Input: nomadik-ske-keypad - Fix a loop timeout test Dan Carpenter
2018-12-21  8:40 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox