Linux Power Management development
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Domenico Andreoli <domenico.andreoli@linux.com>
Cc: Pavel Machek <pavel@ucw.cz>, Linux PM <linux-pm@vger.kernel.org>
Subject: Re: [PATCH 1/2] uswsusp: use enter/leave helpers and make a global variable static
Date: Sun, 26 Apr 2020 18:11:06 +0200	[thread overview]
Message-ID: <6707632.IUqc4LGj7b@kreacher> (raw)
In-Reply-To: <20200413193718.883336371@gmail.com>

On Monday, April 13, 2020 9:08:44 PM CEST Domenico Andreoli wrote:
> From: Domenico Andreoli <domenico.andreoli@linux.com>
> 
> Regulate access to the userspace software suspend state via helper
> functions instead of a global variable.

IMO this can be done regardless of the second patch.

Some minor naming nits below.

> Signed-off-by: Domenico Andreoli <domenico.andreoli@linux.com>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Linux PM <linux-pm@vger.kernel.org>
> 
> ---
>  kernel/power/hibernate.c |    8 ++++----
>  kernel/power/power.h     |    6 +++---
>  kernel/power/user.c      |   20 +++++++++++++++-----
>  3 files changed, 22 insertions(+), 12 deletions(-)
> 
> Index: b/kernel/power/user.c
> ===================================================================
> --- a/kernel/power/user.c
> +++ b/kernel/power/user.c
> @@ -37,7 +37,17 @@ static struct snapshot_data {
>  	bool free_bitmaps;
>  } snapshot_state;
>  
> -atomic_t snapshot_device_available = ATOMIC_INIT(1);
> +static atomic_t snapshot_device_available = ATOMIC_INIT(1);
> +
> +bool swsusp_try_enter(void)

Why not to call it snapshot_device_acquire() ->

> +{
> +	return atomic_add_unless(&snapshot_device_available, -1, 0);
> +}
> +
> +void swsusp_leave(void)
> +{

-> and this snapshot_device_release(), or something to that effect?

"swsusp" is a legacy name.

Thanks!




  reply	other threads:[~2020-04-26 16:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-13 19:08 [PATCH 0/2] Preparing to phase out uswsusp Domenico Andreoli
2020-04-13 19:08 ` [PATCH 1/2] uswsusp: use enter/leave helpers and make a global variable static Domenico Andreoli
2020-04-26 16:11   ` Rafael J. Wysocki [this message]
2020-04-13 19:08 ` [PATCH 2/2] uswsusp: build only when configured Domenico Andreoli
2020-04-26 16:16   ` Rafael J. Wysocki
2020-04-27  9:48     ` Domenico Andreoli
2020-04-29 11:20       ` Rafael J. Wysocki
2020-05-01  7:10         ` Domenico Andreoli
2020-05-01 14:54           ` Rafael J. Wysocki
2020-05-03 13:31             ` Domenico Andreoli
2020-05-03 17:25               ` Domenico Andreoli
2020-04-26 15:46 ` [PATCH 0/2] Preparing to phase out uswsusp Rafael J. Wysocki
2020-04-27  9:53   ` Domenico Andreoli
2020-04-29 11:06     ` Rafael J. Wysocki
2020-05-03 11:19       ` Domenico Andreoli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6707632.IUqc4LGj7b@kreacher \
    --to=rjw@rjwysocki.net \
    --cc=domenico.andreoli@linux.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox