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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Yl++PMZWWwZkbVUg@hovoldconsulting.com>
Date:   Wed, 20 Apr 2022 10:03:08 +0200
From:   Johan Hovold <johan@...nel.org>
To:     cgel.zte@...il.com
Cc:     linux-kernel@...r.kernel.org, Minghao Chi <chi.minghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] gnss: Use pm_runtime_resume_and_get instead of
 pm_runtime_get_sync

On Tue, Apr 19, 2022 at 11:06:42AM +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/gnss/serial.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gnss/serial.c b/drivers/gnss/serial.c
> index 5d8e9bfb24d0..afa7a08d718e 100644
> --- a/drivers/gnss/serial.c
> +++ b/drivers/gnss/serial.c
> @@ -32,11 +32,9 @@ static int gnss_serial_open(struct gnss_device *gdev)
>  	serdev_device_set_baudrate(serdev, gserial->speed);
>  	serdev_device_set_flow_control(serdev, false);
>  
> -	ret = pm_runtime_get_sync(&serdev->dev);
> -	if (ret < 0) {
> -		pm_runtime_put_noidle(&serdev->dev);
> +	ret = pm_runtime_resume_and_get(&serdev->dev);
> +	if (ret < 0)
>  		goto err_close;
> -	}
>  
>  	return 0;

Same comments apply here:

	https://lore.kernel.org/lkml/Yl+948unOoDFdLe2@hovoldconsulting.com/T/#t

Johan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ