From: Pavel Machek <pavel@ucw.cz>
To: Yangtao Li <tiny.windzz@gmail.com>
Cc: rjw@rjwysocki.net, len.brown@intel.com, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PM / sleep: convert to DEFINE_SHOW_ATTRIBUTE
Date: Tue, 11 Dec 2018 18:42:42 +0100 [thread overview]
Message-ID: <20181211174242.GA11538@amd> (raw)
In-Reply-To: <20181211162048.21906-1-tiny.windzz@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1378 bytes --]
On Tue 2018-12-11 11:20:48, Yangtao Li wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
>
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
> ---
> kernel/power/main.c | 15 ++-------------
> 1 file changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/kernel/power/main.c b/kernel/power/main.c
> index 35b50823d83b..98e76cad128b 100644
> --- a/kernel/power/main.c
> +++ b/kernel/power/main.c
> @@ -318,23 +318,12 @@ static int suspend_stats_show(struct seq_file *s, void *unused)
>
> return 0;
> }
> -
> -static int suspend_stats_open(struct inode *inode, struct file *file)
> -{
> - return single_open(file, suspend_stats_show, NULL);
> -}
> -
> -static const struct file_operations suspend_stats_operations = {
> - .open = suspend_stats_open,
> - .read = seq_read,
> - .llseek = seq_lseek,
> - .release = single_release,
> -};
> +DEFINE_SHOW_ATTRIBUTE(suspend_stats);
>
> static int __init pm_debugfs_init(void)
> {
> debugfs_create_file("suspend_stats", S_IFREG | S_IRUGO,
> - NULL, NULL, &suspend_stats_operations);
> + NULL, NULL, &suspend_stats_fops);
> return 0;
> }
>
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2018-12-11 17:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-11 16:20 [PATCH] PM / sleep: convert to DEFINE_SHOW_ATTRIBUTE Yangtao Li
2018-12-11 17:42 ` Pavel Machek [this message]
2018-12-17 11:42 ` Rafael J. Wysocki
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=20181211174242.GA11538@amd \
--to=pavel@ucw.cz \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=tiny.windzz@gmail.com \
/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