Skip to contentSkip to conversation

Staging: lusture: Remove an open coded simple_open() function

PATCH Superseded Abdul, Hussain (H.) 2 participants 2 messages Jun 16, 2015 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: lusture: Remove an open coded simple_open() function

From: Abdul Hussain <[email protected]>

This patch removes an open coded simple_open() function and replace file operations references to the function with simple_open() instead

---
 drivers/staging/lustre/lustre/fld/lproc_fld.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/staging/lustre/lustre/fld/lproc_fld.c +1 -8
index b35ff28..d19b724 100644
@@ -143,13 +143,6 @@ fld_debugfs_cache_flush_write(struct file *file, const char __user *buffer,
 }
 
 static int
-fld_debugfs_cache_flush_open(struct inode *inode, struct file *file)
-{
-	file->private_data = inode->i_private;
-	return 0;
-}
-
-static int
 fld_debugfs_cache_flush_release(struct inode *inode, struct file *file)
 {
 	file->private_data = NULL;
@@ -158,7 +151,7 @@ fld_debugfs_cache_flush_release(struct inode *inode, struct file *file)
 
 static struct file_operations fld_debugfs_cache_flush_fops = {
 	.owner		= THIS_MODULE,
-	.open		= fld_debugfs_cache_flush_open,
+	.open = simple_open,
 	.write		= fld_debugfs_cache_flush_write,
 	.release	= fld_debugfs_cache_flush_release,
 };
Signature · 1 line
1.9.1
#1 lore raw
Quoted 29 lines · Hussain (H.)

From: Abdul Hussain <[email protected]>

This patch removes an open coded simple_open() function and replace file operations references to the function with simple_open() instead

---
drivers/staging/lustre/lustre/fld/lproc_fld.c | 9 +--------

1 file changed, 1 insertion(+), 8 deletions(-)
drivers/staging/lustre/lustre/fld/lproc_fld.c +0 -0
index b35ff28..d19b724 100644
@@ -143,13 +143,6 @@ fld_debugfs_cache_flush_write(struct file *file, const char __user *buffer,
 }
 

static int

drivers/staging/lustre/lustre/fld/lproc_fld.c +0 -7
-fld_debugfs_cache_flush_open(struct inode *inode, struct file *file)
-{
-	file->private_data = inode->i_private;
-	return 0;
-}
-
-static int

fld_debugfs_cache_flush_release(struct inode *inode, struct file *file)

{
	file->private_data = NULL;

drivers/staging/lustre/lustre/fld/lproc_fld.c fld_debugfs_cache_flush_release(struct inode *inode, struct file *file) · line 154

Quoted 5 lines
drivers/staging/lustre/lustre/fld/lproc_fld.c +1 -1
@@ -158,7 +151,7 @@ fld_debugfs_cache_flush_release(struct inode *inode, struct file *file)
 
 static struct file_operations fld_debugfs_cache_flush_fops = {
 	.owner		= THIS_MODULE,
-	.open		= fld_debugfs_cache_flush_open,
+	.open = simple_open,

Could you please save the indenting to match the rest of this structure assignment?

Quoted 5 lines
drivers/staging/lustre/lustre/fld/lproc_fld.c +0 -0
 	.write		= fld_debugfs_cache_flush_write,
 	.release	= fld_debugfs_cache_flush_release,
 };
Signature · 1 line
1.9.1