simple_open: automatically convert to simple_open()
authorStephen Boyd <sboyd@codeaurora.org>
Thu, 5 Apr 2012 21:25:11 +0000 (14:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 5 Apr 2012 22:25:50 +0000 (15:25 -0700)
commit234e340582901211f40d8c732afc49f0630ecf05
tree753076500dfd883b3db56d4f5410af31d8945623
parent9b3ae64be658a573b33d05a8dc73b08d3345fa44
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>
63 files changed:
arch/arm/mach-msm/smd_debug.c
arch/x86/kernel/kdebugfs.c
drivers/acpi/ec_sys.c
drivers/base/regmap/regmap-debugfs.c
drivers/bluetooth/btmrvl_debugfs.c
drivers/char/virtio_console.c
drivers/dma/coh901318.c
drivers/gpu/drm/i915/i915_debugfs.c
drivers/hid/hid-picolcd.c
drivers/hid/hid-wiimote-debug.c
drivers/idle/i7300_idle.c
drivers/iommu/omap-iommu-debug.c
drivers/mfd/aat2870-core.c
drivers/mfd/ab3100-core.c
drivers/misc/ibmasm/ibmasmfs.c
drivers/mtd/ubi/debug.c
drivers/net/caif/caif_spi.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/wimax/i2400m/debugfs.c
drivers/net/wireless/ath/ath5k/debug.c
drivers/net/wireless/ath/ath6kl/debug.c
drivers/net/wireless/ath/ath9k/debug.c
drivers/net/wireless/ath/ath9k/dfs_debug.c
drivers/net/wireless/ath/ath9k/htc_drv_debug.c
drivers/net/wireless/ath/ath9k/rc.c
drivers/net/wireless/ath/carl9170/debug.c
drivers/net/wireless/b43/debugfs.c
drivers/net/wireless/b43legacy/debugfs.c
drivers/net/wireless/iwlegacy/3945-rs.c
drivers/net/wireless/iwlegacy/4965-rs.c
drivers/net/wireless/iwlegacy/debug.c
drivers/net/wireless/iwlwifi/iwl-agn-rs.c
drivers/net/wireless/iwlwifi/iwl-debugfs.c
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
drivers/net/wireless/iwmc3200wifi/debugfs.c
drivers/net/wireless/iwmc3200wifi/sdio.c
drivers/net/wireless/libertas/debugfs.c
drivers/net/wireless/mwifiex/debugfs.c
drivers/net/wireless/wl1251/debugfs.c
drivers/net/wireless/wl12xx/debugfs.c
drivers/oprofile/oprofilefs.c
drivers/remoteproc/remoteproc_debugfs.c
drivers/scsi/lpfc/lpfc_debugfs.c
drivers/spi/spi-dw.c
drivers/tty/serial/mfd.c
drivers/tty/serial/pch_uart.c
drivers/usb/core/inode.c
drivers/usb/host/ehci-dbg.c
drivers/uwb/uwb-debug.c
fs/debugfs/file.c
fs/dlm/debug_fs.c
fs/pstore/inode.c
kernel/trace/blktrace.c
net/mac80211/debugfs.c
net/mac80211/debugfs.h
net/mac80211/debugfs_key.c
net/mac80211/debugfs_netdev.c
net/mac80211/debugfs_sta.c
net/mac80211/rate.c
net/wireless/debugfs.c
sound/soc/imx/imx-audmux.c
sound/soc/soc-core.c
sound/soc/soc-dapm.c