lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YmYbihgXZTs9pgOg@google.com>
Date:   Sun, 24 Apr 2022 20:54:50 -0700
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     cgel.zte@...il.com
Cc:     linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
        Minghao Chi <chi.minghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] input: omap4-keypad: using pm_runtime_resume_and_get
 instead of pm_runtime_get_sync

On Thu, Apr 14, 2022 at 08:57:10AM +0000, cgel.zte@...il.com wrote:
> From: Minghao Chi <chi.minghao@....com.cn>
> 
> Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
> pm_runtime_put_noidle. This change is just to simplify the code, no
> actual functional changes.
> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
> ---
>  drivers/input/keyboard/omap4-keypad.c | 21 +++++++--------------
>  1 file changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
> index 43375b38ee59..df6ab8006807 100644
> --- a/drivers/input/keyboard/omap4-keypad.c
> +++ b/drivers/input/keyboard/omap4-keypad.c
> @@ -179,11 +179,9 @@ static irqreturn_t omap4_keypad_irq_thread_fn(int irq, void *dev_id)
>  	int error;
>  	u64 keys;
>  
> -	error = pm_runtime_get_sync(dev);
> -	if (error < 0) {
> -		pm_runtime_put_noidle(dev);
> +	error = pm_runtime_resume_and_get(dev);
> +	if (error < 0)

pm_runtime_resume_and_get() returns 0 or negative error, so we can
simplify the check to "if (error)".

I adjusted locally and applied, thank you.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ