diff mbox

rtlwifi: fix simple_open.cocci warnings

Message ID 20170701035913.GA30871@lkp-wsm-ep2 (mailing list archive)
State Not Applicable
Delegated to: Kalle Valo
Headers show

Commit Message

kernel test robot July 1, 2017, 3:59 a.m. UTC
drivers/net/wireless/realtek/rtlwifi/debug.c:398:11-27: WARNING opportunity for simple_open, see also structure on line 418

 Remove an open coded simple_open() function
 and replace file operations references to the function
 with simple_open() instead.

Generated by: scripts/coccinelle/api/simple_open.cocci

Fixes: 3c78fae9727a ("rtlwifi: use debugfs to debug.")
CC: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 debug.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
diff mbox

Patch

--- a/drivers/net/wireless/realtek/rtlwifi/debug.c
+++ b/drivers/net/wireless/realtek/rtlwifi/debug.c
@@ -395,13 +395,6 @@  static ssize_t rtl_debugfs_set_write_reg
 	return count;
 }
 
-static int rtl_debugfs_open(struct inode *inode, struct file *filp)
-{
-	filp->private_data = inode->i_private;
-
-	return 0;
-}
-
 static int rtl_debugfs_close(struct inode *inode, struct file *filp)
 {
 	return 0;
@@ -415,7 +408,7 @@  static struct rtl_debgufs_priv rtl_debug
 static const struct file_operations file_ops_write_reg = {
 	.owner = THIS_MODULE,
 	.write = rtl_debugfs_set_write_reg,
-	.open = rtl_debugfs_open,
+	.open = simple_open,
 	.release = rtl_debugfs_close,
 };