mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: akpm@linux-foundation.org
To: andriy.shevchenko@linux.intel.com, akpm@linux-foundation.org,
	cl@linux.com, dennisszhou@gmail.com, mawilcox@microsoft.com,
	minchan@kernel.org, ngupta@vflare.org,
	sergey.senozhatsky.work@gmail.com, tj@kernel.org,
	mm-commits@vger.kernel.org
Subject: + mm-re-use-define_show_attribute-macro.patch added to -mm tree
Date: Wed, 14 Feb 2018 16:23:33 -0800	[thread overview]
Message-ID: <5a84d305.3vFDeL/NYbGvf5ql%akpm@linux-foundation.org> (raw)


The patch titled
     Subject: mm: reuse DEFINE_SHOW_ATTRIBUTE() macro
has been added to the -mm tree.  Its filename is
     mm-re-use-define_show_attribute-macro.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-re-use-define_show_attribute-macro.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-re-use-define_show_attribute-macro.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: mm: reuse DEFINE_SHOW_ATTRIBUTE() macro

...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.

Link: http://lkml.kernel.org/r/20180214154644.54505-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Dennis Zhou <dennisszhou@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/backing-dev.c  |   12 +-----------
 mm/memblock.c     |   12 +-----------
 mm/percpu-stats.c |   12 +-----------
 mm/zsmalloc.c     |   12 +-----------
 4 files changed, 4 insertions(+), 44 deletions(-)

diff -puN mm/backing-dev.c~mm-re-use-define_show_attribute-macro mm/backing-dev.c
--- a/mm/backing-dev.c~mm-re-use-define_show_attribute-macro
+++ a/mm/backing-dev.c
@@ -101,17 +101,7 @@ static int bdi_debug_stats_show(struct s
 	return 0;
 }
 
-static int bdi_debug_stats_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, bdi_debug_stats_show, inode->i_private);
-}
-
-static const struct file_operations bdi_debug_stats_fops = {
-	.open		= bdi_debug_stats_open,
-	.read		= seq_read,
-	.llseek		= seq_lseek,
-	.release	= single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(bdi_debug_stats);
 
 static int bdi_debug_register(struct backing_dev_info *bdi, const char *name)
 {
diff -puN mm/memblock.c~mm-re-use-define_show_attribute-macro mm/memblock.c
--- a/mm/memblock.c~mm-re-use-define_show_attribute-macro
+++ a/mm/memblock.c
@@ -1824,17 +1824,7 @@ static int memblock_debug_show(struct se
 	return 0;
 }
 
-static int memblock_debug_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, memblock_debug_show, inode->i_private);
-}
-
-static const struct file_operations memblock_debug_fops = {
-	.open = memblock_debug_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(memblock_debug);
 
 static int __init memblock_init_debugfs(void)
 {
diff -puN mm/percpu-stats.c~mm-re-use-define_show_attribute-macro mm/percpu-stats.c
--- a/mm/percpu-stats.c~mm-re-use-define_show_attribute-macro
+++ a/mm/percpu-stats.c
@@ -224,17 +224,7 @@ alloc_buffer:
 	return 0;
 }
 
-static int percpu_stats_open(struct inode *inode, struct file *filp)
-{
-	return single_open(filp, percpu_stats_show, NULL);
-}
-
-static const struct file_operations percpu_stats_fops = {
-	.open		= percpu_stats_open,
-	.read		= seq_read,
-	.llseek		= seq_lseek,
-	.release	= single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(percpu_stats);
 
 static int __init init_percpu_stats_debugfs(void)
 {
diff -puN mm/zsmalloc.c~mm-re-use-define_show_attribute-macro mm/zsmalloc.c
--- a/mm/zsmalloc.c~mm-re-use-define_show_attribute-macro
+++ a/mm/zsmalloc.c
@@ -642,17 +642,7 @@ static int zs_stats_size_show(struct seq
 	return 0;
 }
 
-static int zs_stats_size_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, zs_stats_size_show, inode->i_private);
-}

                 reply	other threads:[~2018-02-15  0:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=5a84d305.3vFDeL/NYbGvf5ql%akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=cl@linux.com \
    --cc=dennisszhou@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mawilcox@microsoft.com \
    --cc=minchan@kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=ngupta@vflare.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=tj@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).