Skip to contentSkip to conversation

fnic: use simple_open instead of fnic_trace_ctrl_open

PATCH In review Camelia Groza 2 participants 2 messages Jul 12, 2013 – Jul 13, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fnic: use simple_open instead of fnic_trace_ctrl_open

This removes the open coded fnic_trace_ctrl_open() function and replaces file operations references to the function with simple_open() instead.

Found using coccinelle.

---
 drivers/scsi/fnic/fnic_debugfs.c |   19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)
drivers/scsi/fnic/fnic_debugfs.c +1 -18
index cbcb012..ddc7e94 100644
@@ -25,23 +25,6 @@ static struct dentry *fnic_trace_debugfs_file;
 static struct dentry *fnic_trace_enable;
 
 /*
- * fnic_trace_ctrl_open - Open the trace_enable file
- * @inode: The inode pointer.
- * @file: The file pointer to attach the trace enable/disable flag.
- *
- * Description:
- * This routine opens a debugsfs file trace_enable.
- *
- * Returns:
- * This function returns zero if successful.
- */
-static int fnic_trace_ctrl_open(struct inode *inode, struct file *filp)
-{
-	filp->private_data = inode->i_private;
-	return 0;
-}
-
-/*
  * fnic_trace_ctrl_read - Read a trace_enable debugfs file
  * @filp: The file pointer to read from.
  * @ubuf: The buffer to copy the data to.
@@ -222,7 +205,7 @@ static int fnic_trace_debugfs_release(struct inode *inode,
 
 static const struct file_operations fnic_trace_ctrl_fops = {
 	.owner = THIS_MODULE,
-	.open = fnic_trace_ctrl_open,
+	.open = simple_open,
 	.read = fnic_trace_ctrl_read,
 	.write = fnic_trace_ctrl_write,
 };
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 49 lines · Camelia Groza

This removes the open coded fnic_trace_ctrl_open() function and replaces file operations references to the function with simple_open() instead.

Found using coccinelle.

---
drivers/scsi/fnic/fnic_debugfs.c | 19 +------------------

1 file changed, 1 insertion(+), 18 deletions(-)
drivers/scsi/fnic/fnic_debugfs.c +1 -18
index cbcb012..ddc7e94 100644
@@ -25,23 +25,6 @@ static struct dentry *fnic_trace_debugfs_file;
 static struct dentry *fnic_trace_enable;
 
 /*
- * fnic_trace_ctrl_open - Open the trace_enable file
- * @inode: The inode pointer.
- * @file: The file pointer to attach the trace enable/disable flag.
- *
- * Description:
- * This routine opens a debugsfs file trace_enable.
- *
- * Returns:
- * This function returns zero if successful.
- */
-static int fnic_trace_ctrl_open(struct inode *inode, struct file *filp)
-{
-	filp->private_data = inode->i_private;
-	return 0;
-}
-
-/*
 * fnic_trace_ctrl_read - Read a trace_enable debugfs file
 * @filp: The file pointer to read from.
 * @ubuf: The buffer to copy the data to.
@@ -222,7 +205,7 @@ static int fnic_trace_debugfs_release(struct inode
 *inode,
 
 static const struct file_operations fnic_trace_ctrl_fops = {
 	.owner = THIS_MODULE,
-	.open = fnic_trace_ctrl_open,
+	.open = simple_open,
 	.read = fnic_trace_ctrl_read,
 	.write = fnic_trace_ctrl_write,
Quoted 3 lines

};

Signature · 1 line
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html