kernel-hacking-2024-linux-s.../drivers/char
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
..
agp Merge remote-tracking branch 'airlied/drm-fixes' into drm-intel-next-queued 2012-02-10 17:14:49 +01:00
hw_random ARM: global cleanups 2012-03-27 16:03:32 -07:00
ipmi ipmi: use locks on watchdog timeout set on reboot 2012-03-28 17:14:36 -07:00
mwave
pcmcia TTY: remove unneeded tty->index checks 2012-03-08 11:42:21 -08:00
tpm Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2012-03-21 13:25:04 -07:00
xilinx_hwicap
apm-emulation.c
applicom.c
applicom.h
bfin-otp.c
bsr.c
ds1302.c
ds1620.c
dsp56k.c
dtlk.c
efirtc.c
generic_nvram.c
genrtc.c
hangcheck-timer.c
hpet.c
i8k.c module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
Kconfig tty: delete briq_panel.c driver 2012-03-08 10:45:55 -08:00
lp.c module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
Makefile tty: delete briq_panel.c driver 2012-03-08 10:45:55 -08:00
mbcs.c
mbcs.h
mem.c switch device_get_devnode() and ->devnode() to umode_t * 2012-01-03 22:54:55 -05:00
misc.c switch device_get_devnode() and ->devnode() to umode_t * 2012-01-03 22:54:55 -05:00
mmtimer.c
msm_smd_pkt.c
mspec.c
nsc_gpio.c
nvram.c drivers/char: comment fix: CMOS RTC update code is now in kernel/time/ntp.c 2012-02-03 22:50:56 +01:00
nwbutton.c
nwbutton.h
nwflash.c module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
pc8736x_gpio.c
ppdev.c
ps3flash.c
ramoops.c char/ramoops: included linux/err.h twice 2012-02-24 14:16:43 -08:00
random.c Merge branch 'x86/rdrand' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-01-16 18:23:09 -08:00
raw.c switch device_get_devnode() and ->devnode() to umode_t * 2012-01-03 22:54:55 -05:00
rtc.c drivers/char: comment fix: CMOS RTC update code is now in kernel/time/ntp.c 2012-02-03 22:50:56 +01:00
scx200_gpio.c
snsc.c
snsc.h
snsc_event.c
sonypi.c
tb0219.c
tile-srom.c switch device_get_devnode() and ->devnode() to umode_t * 2012-01-03 22:54:55 -05:00
tlclk.c char: Fix typo in tlclk.c 2012-02-09 23:09:37 +01:00
toshiba.c
ttyprintk.c TTY: remove re-assignments to tty_driver members 2012-03-08 11:37:58 -08:00
uv_mmtimer.c
virtio_console.c simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00