Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1643528pxk; Fri, 18 Sep 2020 19:53:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFYWP1ZsAxlNrdMsB4Z3nYMaQKdo4N4UZfh5mCiN742CHsFFnI6SHeVZu7xaVqFTUJ+T1E X-Received: by 2002:a17:906:4a51:: with SMTP id a17mr38667684ejv.381.1600484010785; Fri, 18 Sep 2020 19:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600484010; cv=none; d=google.com; s=arc-20160816; b=rFheJJg4MJF/VD/JlEwrHRHupI1QipTQU/ZSA8bRklJqkV2UNfG74QPsiznIXuDt/g 4xoKj98Z4LmqPPVKZ6RS6zXQFB2+QMJLnEg7pR4N8UGJDi6ofqDxjujoM7m8s7DPw/5c 0dhkn7RJWVfQ11XO7lVKt0i7PFDyhaErl6y414cChFutbJeZIZMXR5FUzYzIlbF6LHno zTkH15sOYuR6VOZ0qO3f+CR3nm9E1+JbRyL2iryVy2nxbnpN1W+h/9byWQRvzhcGz3E1 6q7ydCf65WzfDBsz8II8IhMoBEEpgPscncBL3m+bMdWHmoXjEXbYmc15gGON9OG4O3B5 DcRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=WeUKzi7pMJjCzANeG/fglYrGe3WBSl2aikq0JduE79c=; b=eOG/mQgdSLwolRWauK37rtgNw+SfGmIvOqyE+TWmlk+wg16kCpZDLljsyzIK6yPbYf pq3MUDd86xF4Y4CSRUh5HTQKYa18OUPxYaRXI/zS+yKI5nH5j7RSntCWJue3uzjJYKXC ltQ7y7SUskSb1Gs1U3rxl0xwIUHfK4tqwt739aVZahavIqVu5gXQM8Ig+B/EGgZKP+oT UPqB14RKNX0tJY0deOEjfLCxRFU6SMRSRe9mhIWFIeHnzTU2dZj8a9pzPAWHVZBq5YzO yAbzu7xPiBrmSwCtkXLl2wtdUCeY0SJCmNArGCuXfo2hehrjxSEiOdeSY30zOhe79a+B NcYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si3491263edv.217.2020.09.18.19.53.07; Fri, 18 Sep 2020 19:53:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726452AbgISCvw (ORCPT + 99 others); Fri, 18 Sep 2020 22:51:52 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:43186 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726009AbgISCvn (ORCPT ); Fri, 18 Sep 2020 22:51:43 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 4C23BE540AD0EEDBBE14; Sat, 19 Sep 2020 10:51:42 +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; Sat, 19 Sep 2020 10:51:32 +0800 From: Qinglang Miao To: Karan Tilak Kumar , Sesidhar Baddela , "James E.J. Bottomley" , "Martin K. Petersen" CC: , , "Qinglang Miao" Subject: [PATCH -next v2] scsi: snic: Convert to DEFINE_SHOW_ATTRIBUTE Date: Sat, 19 Sep 2020 10:52:04 +0800 Message-ID: <20200919025204.17597-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Qinglang Miao --- v2: based on linux-next(20200917), and can be applied to mainline cleanly now. drivers/scsi/snic/snic_debugfs.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/scsi/snic/snic_debugfs.c b/drivers/scsi/snic/snic_debugfs.c index 2b3493655..a142e17aa 100644 --- a/drivers/scsi/snic/snic_debugfs.c +++ b/drivers/scsi/snic/snic_debugfs.c @@ -334,25 +334,7 @@ snic_stats_show(struct seq_file *sfp, void *data) return 0; } -/* - * snic_stats_open - Open the stats file for specific host - * - * 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 = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(snic_stats); static const struct file_operations snic_reset_stats_fops = { .owner = THIS_MODULE, -- 2.23.0