From patchwork Tue Nov 21 21:15:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasyl Gomonovych X-Patchwork-Id: 10068893 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 71F286038F for ; Tue, 21 Nov 2017 21:16:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F911299FD for ; Tue, 21 Nov 2017 21:16:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 537BE29A09; Tue, 21 Nov 2017 21:16:05 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 BFF54299FD for ; Tue, 21 Nov 2017 21:16:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751549AbdKUVQD (ORCPT ); Tue, 21 Nov 2017 16:16:03 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:34898 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbdKUVQB (ORCPT ); Tue, 21 Nov 2017 16:16:01 -0500 Received: by mail-lf0-f67.google.com with SMTP id o41so15769968lfi.2 for ; Tue, 21 Nov 2017 13:16:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=fzP/Ai40y5EfUVNlEzJusnTI63myy3cl4KooLhUHNjw=; b=e9XH1lSkcOhvB8xyFeBbYvhpS0DCgMAoeEhertNvYb1ENKWEziyJuZX7F6nCNjQ5rU Hk/KzHmp8NvQ43HkkRucNc6osT5r//5St7hK/4yxpdSfzFahVsKoJHHxR3soRr9Ge+ZW d8izFUr3J3JqOcU6/dgPIUs/TgMMDEUvxYvLXDZoTXi70riH73FHMhvbYeTGgKhNfm0I OTFn0othjwA4DW3bqNnCu0PVyxN1IDmN+lOZH0wVOVUYBlhZE/HNiG9J38eQGDufTmRV 25tVaLIgn549YUoJREqmiaODR+wGNEgnbnguB0H6s0boCzTZbJ00Io0vDo+SOZzP0lQl qrsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fzP/Ai40y5EfUVNlEzJusnTI63myy3cl4KooLhUHNjw=; b=RDGLySSWXofFQCpOYdGb0qNnrY0yD3BqRyBg4pVxcpIY1GFKkyEbiR9BcKzf4DZhTr x7qhQE28WVR+7VWMUg20tHUcOfxYoI4ZXCyFk2h72rsH77BQGKntGlmiuVbOOG5afyAh SmI34sEkm8X0RxdGwEyZsXgbRiWqBfuJB3uq8s8IikzoFaxc+WPgmhxeI6kLQE6odF5j YDqa8xSfX+bYK9C0eO06/c3c5QD1nzM8ExwUOh9YcbM0kfrYAPCN0R1dRjHKtrH3QpSZ H5EVeTqq+SatOso+eeWbRBhz2yUR9Jg+WsNyRyrqSQ6MH2CcAG7g76nuymafr4cNSgf2 CZyg== X-Gm-Message-State: AJaThX5oAXT9ngMQENwjie1Kkr+pbyZal4P+5xnqfmqVDj4PEmutO4Bc ycCPGzzkwAn60rloGnJxwZE= X-Google-Smtp-Source: AGs4zMYSz1ZOu3VmCDmbDoYAjL2j+BV8T9ygOkpwdc5rKNXkjrog0RKWq8jVHAiW/fydvtVxsDFvEA== X-Received: by 10.46.93.2 with SMTP id r2mr6201810ljb.182.1511298960113; Tue, 21 Nov 2017 13:16:00 -0800 (PST) Received: from localhost.localdomain ([195.254.138.66]) by smtp.gmail.com with ESMTPSA id c29sm1202658ljd.41.2017.11.21.13.15.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Nov 2017 13:15:59 -0800 (PST) From: Vasyl Gomonovych To: satishkh@cisco.com, sebaddel@cisco.com, kartilak@cisco.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, gomonovych@gmail.com Subject: [PATCH] [SCSI] fnic: Fix coccinelle warnings Date: Tue, 21 Nov 2017 22:15:46 +0100 Message-Id: <1511298946-26600-1-git-send-email-gomonovych@gmail.com> X-Mailer: git-send-email 1.9.1 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 Remove the duplicate copies of this simple function and use an open-coded version. drivers/scsi/fnic/fnic_debugfs.c:122:11-31: WARNING opportunity for simple_open, see also structure on line 223 Generated by: coccinelle/api/simple_open.cocci Signed-off-by: Vasyl Gomonovych --- drivers/scsi/fnic/fnic_debugfs.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/scsi/fnic/fnic_debugfs.c b/drivers/scsi/fnic/fnic_debugfs.c index 5e3d909cfc53..9858484dd126 100644 --- 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(struct file *filp, 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, };