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] [thread-next>] [day] [month] [year] [list]
Message-ID: <aG4sZohbXE6kmq2G@smile.fi.intel.com>
Date: Wed, 9 Jul 2025 11:46:30 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc: Jonathan Cameron <jic23@...nel.org>,
	David Lechner <dlechner@...libre.com>,
	Nuno Sá <nuno.sa@...log.com>,
	Andy Shevchenko <andy@...nel.org>,
	Waqar Hameed <waqar.hameed@...s.com>,
	Greg KH <gregkh@...uxfoundation.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Julien Stephan <jstephan@...libre.com>, Bo Liu <liubo03@...pur.com>,
	Al Viro <viro@...iv.linux.org.uk>, Sean Nyekjaer <sean@...nix.com>,
	Haibo Chen <haibo.chen@....com>, Han Xu <han.xu@....com>,
	Francisco Henriques <franciscolealhenriques@....br>,
	Gustavo Vaz <gustavo.vaz@....br>,
	Matti Vaittinen <mazziesaccount@...il.com>,
	linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 01/12] iio: accel: Remove redundant
 pm_runtime_mark_last_busy() calls

On Wed, Jul 09, 2025 at 02:11:51AM +0300, Sakari Ailus wrote:
> pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
> pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
> to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
> pm_runtime_mark_last_busy().

...

> -	if (on) {
> +	if (on)
>  		ret = pm_runtime_resume_and_get(dev);
> -	} else {
> -		pm_runtime_mark_last_busy(dev);
> +	else
>  		ret = pm_runtime_put_autosuspend(dev);
> -	}

The following blank line can be removed as it's done in the other file.

...

Side note: Looking at this, perhaps we can also have a helper to toggle state?

...

>  	if (on)
>  		ret = pm_runtime_resume_and_get(&data->client->dev);
> -	else {
> -		pm_runtime_mark_last_busy(&data->client->dev);
> +	else
>  		ret = pm_runtime_put_autosuspend(&data->client->dev);
> -	}

So, already two users of the potential new helper :-)

...

> -	if (on) {
> +	if (on)
>  		ret = pm_runtime_resume_and_get(&client->dev);
> -	} else {
> -		pm_runtime_mark_last_busy(&client->dev);
> +	else
>  		ret = pm_runtime_put_autosuspend(&client->dev);
> -	}
>  

No blank line?

Three!

>  	if (ret < 0) {

...

>  	if (on)
>  		ret = pm_runtime_resume_and_get(&client->dev);
> -	else {
> -		pm_runtime_mark_last_busy(&client->dev);
> +	else
>  		ret = pm_runtime_put_autosuspend(&client->dev);
> -	}
>  
>  	if (ret < 0) {

As per above and counting...

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ