From patchwork Thu Jul 16 08:44:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qinglang Miao X-Patchwork-Id: 11666893 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77577138C for ; Thu, 16 Jul 2020 08:41:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6817C2071B for ; Thu, 16 Jul 2020 08:41:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727831AbgGPIlU (ORCPT ); Thu, 16 Jul 2020 04:41:20 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:55680 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725867AbgGPIlT (ORCPT ); Thu, 16 Jul 2020 04:41:19 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 038421ACDC979E64FEC3; Thu, 16 Jul 2020 16:41:18 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Thu, 16 Jul 2020 16:41:14 +0800 From: Qinglang Miao To: Greg Kroah-Hartman , Karan Tilak Kumar , Sesidhar Baddela CC: , Subject: [PATCH -next] scsi: snic: Convert to DEFINE_SHOW_ATTRIBUTE Date: Thu, 16 Jul 2020 16:44:15 +0800 Message-ID: <20200716084415.6979-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Yongqiang Liu Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yongqiang Liu --- drivers/scsi/snic/snic_debugfs.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/scsi/snic/snic_debugfs.c b/drivers/scsi/snic/snic_debugfs.c index dbaee7b69..63039505f 100644 --- a/drivers/scsi/snic/snic_debugfs.c +++ b/drivers/scsi/snic/snic_debugfs.c @@ -340,19 +340,7 @@ snic_stats_show(struct seq_file *sfp, void *data) * Description: * This routine opens a debugfs file stats of specific host */ -static int -snic_stats_open(struct inode *inode, struct file *filp) -{ - return single_open(filp, snic_stats_show, inode->i_private); -} - -static const struct file_operations snic_stats_fops = { - .owner = THIS_MODULE, - .open = snic_stats_open, - .read_iter = seq_read_iter, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(snic_stats); static const struct file_operations snic_reset_stats_fops = { .owner = THIS_MODULE,