Search Linux Wireless

[PATCH] rtlwifi: fix simple_open.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---

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

--- 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,
 };
 



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux