Return-path: Received: from mga03.intel.com ([134.134.136.65]:17609 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751370AbdGAD7k (ORCPT ); Fri, 30 Jun 2017 23:59:40 -0400 Date: Sat, 1 Jul 2017 11:59:13 +0800 From: kbuild test robot To: Larry Finger Cc: kbuild-all@01.org, kvalo@codeaurora.org, linux-wireless@vger.kernel.org, Ping-Ke Shih , Larry Finger , Yan-Hsuan Chuang , Birming Chiu , Shaofu , Steven Ting Subject: [PATCH] rtlwifi: fix simple_open.cocci warnings Message-ID: <20170701035913.GA30871@lkp-wsm-ep2> (sfid-20170701_055944_913429_D3C6EF16) References: <201707011153.OdPSd2wB%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20170628151225.22190-10-Larry.Finger@lwfinger.net> Sender: linux-wireless-owner@vger.kernel.org List-ID: 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 Signed-off-by: Fengguang Wu --- 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, };