public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Julia Lawall <Julia.Lawall@lip6.fr>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCHv2] simple_open: Automatically convert to simple_open()
Date: Mon, 19 Mar 2012 12:11:16 +0100	[thread overview]
Message-ID: <20120319111116.GA3376@gmail.com> (raw)
In-Reply-To: <1331976099-19341-1-git-send-email-sboyd@codeaurora.org>


* Stephen Boyd <sboyd@codeaurora.org> wrote:

> Many users of debugfs copy the implementation of default_open()
> when they want to support a custom read/write function op. This
> leads to a proliferation of the default_open() implementation
> across the entire tree. Now that the common implementation has
> been consolidated into libfs we can replace all the users of this
> function with simple_open().
> 
> This replacement was done with the following semantic patch:
> 
> <smpl>
> @ open @
> identifier open_f != simple_open;
> identifier i, f;
> @@
> -int open_f(struct inode *i, struct file *f)
> -{
> (
> -if (i->i_private)
> -f->private_data = i->i_private;
> |
> -f->private_data = i->i_private;
> )
> -return 0;
> -}
> 
> @ has_open depends on open @
> identifier fops;
> identifier open.open_f;
> @@
> struct file_operations fops = {
> ...
> -.open = open_f,
> +.open = simple_open,
> ...
> };
> </smpl>
> 
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Al Viro <viro@zeniv.linux.org.uk>
> Cc: Julia Lawall <Julia.Lawall@lip6.fr>
> Cc: Ingo Molnar <mingo@elte.hu>
> ---
>  arch/arm/mach-msm/smd_debug.c                   |    8 +----
>  arch/x86/kernel/kdebugfs.c                      |    9 +----

My ack for the previous version still holds:

Acked-by: Ingo Molnar <mingo@kernel.org>

Thanks,

	Ingo

      reply	other threads:[~2012-03-19 11:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13  9:46 [PATCHv2 0/3] Introduce simple_open() Stephen Boyd
2012-03-13  9:46 ` [PATCHv2 1/3] libfs: Add simple_open() Stephen Boyd
2012-03-13  9:46 ` [PATCHv2 2/3] coccinelle: semantic patch for simple_open() Stephen Boyd
2012-03-13  9:46 ` [PATCHv2 3/3] simple_open: Automatically convert to simple_open() Stephen Boyd
2012-03-13 10:23   ` Ingo Molnar
2012-03-13 16:14   ` Greg Kroah-Hartman
2012-03-16 23:49   ` Andrew Morton
2012-03-17  9:21     ` [PATCHv2] " Stephen Boyd
2012-03-19 11:11       ` Ingo Molnar [this message]

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=20120319111116.GA3376@gmail.com \
    --to=mingo@kernel.org \
    --cc=Julia.Lawall@lip6.fr \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sboyd@codeaurora.org \
    --cc=viro@zeniv.linux.org.uk \
    /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