* [PATCH] input: touchscreen: wdt87xx_i2c: Replace mdelay() with msleep() in wdt87xx_resume()
@ 2018-07-27 2:32 Jia-Ju Bai
2018-07-27 18:30 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Jia-Ju Bai @ 2018-07-27 2:32 UTC (permalink / raw)
To: dmitry.torokhov, rydberg, gregkh, andi
Cc: linux-input, linux-kernel, Jia-Ju Bai
wdt87xx_resume() is never called in atomic context.
It calls mdelay() to busily wait, which is not necessary.
mdelay() can be replaced with msleep().
This is found by a static analysis tool named DCNS written by myself.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
drivers/input/touchscreen/wdt87xx_i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c
index 20f7f3902757..166edeb77776 100644
--- a/drivers/input/touchscreen/wdt87xx_i2c.c
+++ b/drivers/input/touchscreen/wdt87xx_i2c.c
@@ -1142,7 +1142,7 @@ static int __maybe_unused wdt87xx_resume(struct device *dev)
* The chip may have been reset while system is resuming,
* give it some time to settle.
*/
- mdelay(100);
+ msleep(100);
error = wdt87xx_send_command(client, VND_CMD_START, 0);
if (error)
--
2.17.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] input: touchscreen: wdt87xx_i2c: Replace mdelay() with msleep() in wdt87xx_resume()
2018-07-27 2:32 [PATCH] input: touchscreen: wdt87xx_i2c: Replace mdelay() with msleep() in wdt87xx_resume() Jia-Ju Bai
@ 2018-07-27 18:30 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2018-07-27 18:30 UTC (permalink / raw)
To: Jia-Ju Bai; +Cc: rydberg, gregkh, andi, linux-input, linux-kernel
On Fri, Jul 27, 2018 at 10:32:16AM +0800, Jia-Ju Bai wrote:
> wdt87xx_resume() is never called in atomic context.
> It calls mdelay() to busily wait, which is not necessary.
> mdelay() can be replaced with msleep().
>
> This is found by a static analysis tool named DCNS written by myself.
>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Applied, thank you.
> ---
> drivers/input/touchscreen/wdt87xx_i2c.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c
> index 20f7f3902757..166edeb77776 100644
> --- a/drivers/input/touchscreen/wdt87xx_i2c.c
> +++ b/drivers/input/touchscreen/wdt87xx_i2c.c
> @@ -1142,7 +1142,7 @@ static int __maybe_unused wdt87xx_resume(struct device *dev)
> * The chip may have been reset while system is resuming,
> * give it some time to settle.
> */
> - mdelay(100);
> + msleep(100);
>
> error = wdt87xx_send_command(client, VND_CMD_START, 0);
> if (error)
> --
> 2.17.0
>
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-27 18:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27 2:32 [PATCH] input: touchscreen: wdt87xx_i2c: Replace mdelay() with msleep() in wdt87xx_resume() Jia-Ju Bai
2018-07-27 18:30 ` Dmitry Torokhov
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.