From: Pavel Machek <pavel@denx.de>
To: Qinglang Miao <miaoqinglang@huawei.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Santosh Shilimkar <ssantosh@kernel.org>,
linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] memory: Convert to DEFINE_SHOW_ATTRIBUTE
Date: Fri, 17 Jul 2020 23:14:20 +0200 [thread overview]
Message-ID: <20200717211420.GA4140@amd> (raw)
In-Reply-To: <20200716090303.13154-1-miaoqinglang@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 1438 bytes --]
On Thu 2020-07-16 17:03:03, Qinglang Miao wrote:
> From: Yongqiang Liu <liuyongqiang13@huawei.com>
>
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
>
> Signed-off-by: Yongqiang Liu <liuyongqiang13@huawei.com>
> ---
> drivers/memory/emif.c | 22 ++--------------------
> drivers/memory/tegra/tegra124-emc.c | 14 +-------------
> 2 files changed, 3 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c
> index 58a82eea5..aab8ddad7 100644
> --- a/drivers/memory/emif.c
> +++ b/drivers/memory/emif.c
> @@ -131,16 +131,7 @@ static int emif_regdump_show(struct seq_file *s, void *unused)
> return 0;
> }
>
> -static int emif_regdump_open(struct inode *inode, struct file *file)
> -{
> - return single_open(file, emif_regdump_show, inode->i_private);
> -}
> -
> -static const struct file_operations emif_regdump_fops = {
> - .open = emif_regdump_open,
> - .read_iter = seq_read_iter,
> - .release = single_release,
> -};
> +DEFINE_SHOW_ATTRIBUTE(emif_regdump);
This is not equivalent (and I guess changelog should mention that).
Along with other changes, we get:
.owner = THIS_MODULE,
.llseek = seq_lseek,
. Is that okay thing to add?
Pavel
--
(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:[~2020-07-17 21:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-16 9:03 [PATCH -next] memory: Convert to DEFINE_SHOW_ATTRIBUTE Qinglang Miao
2020-07-17 21:14 ` Pavel Machek [this message]
2020-07-20 2:02 ` miaoqinglang
2020-09-17 12:48 ` miaoqinglang
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=20200717211420.GA4140@amd \
--to=pavel@denx.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miaoqinglang@huawei.com \
--cc=ssantosh@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).