From patchwork Wed Sep 20 22:56:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Meyer X-Patchwork-Id: 9962893 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 74FFE60208 for ; Wed, 20 Sep 2017 22:57:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 674F229267 for ; Wed, 20 Sep 2017 22:57:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C44C29270; Wed, 20 Sep 2017 22:57:42 +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=unavailable 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 17C1D29267 for ; Wed, 20 Sep 2017 22:57:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751905AbdITW52 (ORCPT ); Wed, 20 Sep 2017 18:57:28 -0400 Received: from www17.your-server.de ([213.133.104.17]:40987 "EHLO www17.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751796AbdITW51 (ORCPT ); Wed, 20 Sep 2017 18:57:27 -0400 Received: from [95.222.26.195] (helo=olymp) by www17.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1dunvp-0007hr-BQ; Thu, 21 Sep 2017 00:57:25 +0200 Subject: [PATCH 1/1] [SCSI] fnic: Cocci spatch "simple_open" From: Thomas Meyer To: satishkh@cisco.com, sebaddel@cisco.com, kartilak@cisco.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Mime-Version: 1.0 Message-ID: <1505948185999-1088654362-1-diffsplit-thomas@m3y3r.de> References: <1505948185999-939794353-0-diffsplit-thomas@m3y3r.de> In-Reply-To: <1505948185999-939794353-0-diffsplit-thomas@m3y3r.de> Date: Thu, 21 Sep 2017 00:56:48 +0200 X-Mailer: Evolution 3.22.6-1 X-Authenticated-Sender: thomas@m3y3r.de X-Virus-Scanned: Clear (ClamAV 0.99.2/23857/Wed Sep 20 18:44:07 2017) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This removes an open coded simple_open() function and replaces file operations references to the function with simple_open() instead. Found by coccinelle spatch "api/simple_open.cocci" Signed-off-by: Thomas Meyer diff -u -p a/drivers/scsi/fnic/fnic_debugfs.c b/drivers/scsi/fnic/fnic_debugfs.c --- a/drivers/scsi/fnic/fnic_debugfs.c +++ b/drivers/scsi/fnic/fnic_debugfs.c @@ -108,24 +108,6 @@ void fnic_debugfs_terminate(void) } /* - * fnic_trace_ctrl_open - Open the trace_enable file for fnic_trace - * Or Open fc_trace_enable file for fc_trace - * @inode: The inode pointer. - * @file: The file pointer to attach the trace enable/disable flag. - * - * Description: - * This routine opens a debugsfs file trace_enable or fc_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 trace_enable ,fc_trace_enable * or fc_trace_clear debugfs file @@ -220,7 +202,7 @@ static ssize_t fnic_trace_ctrl_write(str 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, };