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>
Showing
- arch/arm/mach-msm/smd_debug.c 1 addition, 7 deletionsarch/arm/mach-msm/smd_debug.c
- arch/x86/kernel/kdebugfs.c 1 addition, 8 deletionsarch/x86/kernel/kdebugfs.c
- drivers/acpi/ec_sys.c 1 addition, 7 deletionsdrivers/acpi/ec_sys.c
- drivers/base/regmap/regmap-debugfs.c 3 additions, 9 deletionsdrivers/base/regmap/regmap-debugfs.c
- drivers/bluetooth/btmrvl_debugfs.c 10 additions, 16 deletionsdrivers/bluetooth/btmrvl_debugfs.c
- drivers/char/virtio_console.c 1 addition, 7 deletionsdrivers/char/virtio_console.c
- drivers/dma/coh901318.c 1 addition, 8 deletionsdrivers/dma/coh901318.c
- drivers/gpu/drm/i915/i915_debugfs.c 3 additions, 11 deletionsdrivers/gpu/drm/i915/i915_debugfs.c
- drivers/hid/hid-picolcd.c 2 additions, 14 deletionsdrivers/hid/hid-picolcd.c
- drivers/hid/hid-wiimote-debug.c 1 addition, 7 deletionsdrivers/hid/hid-wiimote-debug.c
- drivers/idle/i7300_idle.c 1 addition, 7 deletionsdrivers/idle/i7300_idle.c
- drivers/iommu/omap-iommu-debug.c 2 additions, 8 deletionsdrivers/iommu/omap-iommu-debug.c
- drivers/mfd/aat2870-core.c 1 addition, 8 deletionsdrivers/mfd/aat2870-core.c
- drivers/mfd/ab3100-core.c 1 addition, 7 deletionsdrivers/mfd/ab3100-core.c
- drivers/misc/ibmasm/ibmasmfs.c 1 addition, 7 deletionsdrivers/misc/ibmasm/ibmasmfs.c
- drivers/mtd/ubi/debug.c 1 addition, 9 deletionsdrivers/mtd/ubi/debug.c
- drivers/net/caif/caif_spi.c 2 additions, 8 deletionsdrivers/net/caif/caif_spi.c
- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c 1 addition, 8 deletionsdrivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
- drivers/net/wimax/i2400m/debugfs.c 2 additions, 13 deletionsdrivers/net/wimax/i2400m/debugfs.c
- drivers/net/wireless/ath/ath5k/debug.c 8 additions, 15 deletionsdrivers/net/wireless/ath/ath5k/debug.c
Loading
Please register or sign in to comment