From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51CA7C2D0E1 for ; Wed, 16 Sep 2020 02:28:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D802221E8 for ; Wed, 16 Sep 2020 02:28:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726476AbgIPC2j (ORCPT ); Tue, 15 Sep 2020 22:28:39 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:58530 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726406AbgIPC2G (ORCPT ); Tue, 15 Sep 2020 22:28:06 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 73DDE467085A06020A0E; Wed, 16 Sep 2020 10:28:04 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Wed, 16 Sep 2020 10:27:55 +0800 From: Liu Shixin To: Karan Tilak Kumar , Sesidhar Baddela , "James E . J . Bottomley" , "Martin K . Petersen" CC: , , Liu Shixin Subject: [PATCH -next] scsi: snic: convert to use DEFINE_SEQ_ATTRIBUTE macro Date: Wed, 16 Sep 2020 10:50:30 +0800 Message-ID: <20200916025030.3992991-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code. Signed-off-by: Liu Shixin --- drivers/scsi/snic/snic_debugfs.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/snic/snic_debugfs.c b/drivers/scsi/snic/snic_debugfs.c index 2b349365592f..4471c4c8aafa 100644 --- a/drivers/scsi/snic/snic_debugfs.c +++ b/drivers/scsi/snic/snic_debugfs.c @@ -439,26 +439,14 @@ snic_trc_seq_show(struct seq_file *sfp, void *data) return 0; } -static const struct seq_operations snic_trc_seq_ops = { +static const struct seq_operations snic_trc_sops = { .start = snic_trc_seq_start, .next = snic_trc_seq_next, .stop = snic_trc_seq_stop, .show = snic_trc_seq_show, }; -static int -snic_trc_open(struct inode *inode, struct file *filp) -{ - return seq_open(filp, &snic_trc_seq_ops); -} - -static const struct file_operations snic_trc_fops = { - .owner = THIS_MODULE, - .open = snic_trc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; +DEFINE_SEQ_ATTRIBUTE(snic_trc); /* * snic_trc_debugfs_init : creates trace/tracing_enable files for trace -- 2.25.1