From patchwork Sat Jul 1 03:59:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 9820725 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AFAD06035F for ; Sat, 1 Jul 2017 03:59:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D89D28509 for ; Sat, 1 Jul 2017 03:59:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E7FA28514; Sat, 1 Jul 2017 03:59:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEC5928509 for ; Sat, 1 Jul 2017 03:59:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751900AbdGAD7m (ORCPT ); Fri, 30 Jun 2017 23:59:42 -0400 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 Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jun 2017 20:59:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,290,1496127600"; d="scan'208";a="119653952" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga005.jf.intel.com with ESMTP; 30 Jun 2017 20:59:38 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1dR9cm-000De9-C6; Sat, 01 Jul 2017 12:03:12 +0800 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> References: <201707011153.OdPSd2wB%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170628151225.22190-10-Larry.Finger@lwfinger.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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, };