linux/arch
Stephen Boyd 234e340582 simple_open: automatically convert to simple_open()
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>

[akpm@linux-foundation.org: checkpatch fixes]
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>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-05 15:25:50 -07:00
..
alpha Merge branch 'akpm' (Andrew's patch-bomb) 2012-03-23 16:59:10 -07:00
arm simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
avr32 ARM: device tree work 2012-03-27 16:47:35 -07:00
blackfin nmi watchdog: do not use cpp symbol in Kconfig 2012-03-23 16:58:31 -07:00
c6x Remove remaining bits of io_remap_page_range() 2012-03-23 16:58:31 -07:00
cris Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-03-20 21:04:47 -07:00
frv Merge branch 'kmap_atomic' of git://github.com/congwang/linux 2012-03-21 09:40:26 -07:00
h8300 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-03-20 21:04:47 -07:00
hexagon coredump: remove VM_ALWAYSDUMP flag 2012-03-23 16:58:42 -07:00
ia64 arch/ia64: remove references to cpu_*_map 2012-03-28 17:14:36 -07:00
m32r Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-03-20 21:04:47 -07:00
m68k The following text was taken from the original review request: 2012-03-24 10:08:39 -07:00
microblaze Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze 2012-03-27 18:20:56 -07:00
mips Merge tag 'asoc-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into next/boards 2012-03-27 15:18:19 -07:00
mn10300 Merge branch 'akpm' (Andrew's patch-bomb) 2012-03-23 16:59:10 -07:00
openrisc OpenRISC changes for 3.4 2012-03-23 17:24:25 -07:00
parisc The following text was taken from the original review request: 2012-03-24 10:08:39 -07:00
powerpc The following text was taken from the original review request: 2012-03-24 10:08:39 -07:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2012-03-27 18:36:38 -07:00
score Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-03-20 21:12:50 -07:00
sh ARM: timer cleanup work 2012-03-27 16:06:17 -07:00
sparc The following text was taken from the original review request: 2012-03-24 10:08:39 -07:00
tile smp: introduce a generic on_each_cpu_mask() function 2012-03-28 17:14:35 -07:00
um Merge branch 'for-linus-3.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml 2012-03-27 18:29:53 -07:00
unicore32 Merge branch 'akpm' (Andrew's patch-bomb) 2012-03-23 16:59:10 -07:00
x86 simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
xtensa Merge branch 'akpm' (Andrew's patch-bomb) 2012-03-23 16:59:10 -07:00
.gitignore
Kconfig nmi watchdog: do not use cpp symbol in Kconfig 2012-03-23 16:58:31 -07:00