From: dingsenjie@163.com
To: jejb@linux.ibm.com, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
dingsenjie <dingsenjie@yulong.com>
Subject: [PATCH] scsi: snic: Convert to DEFINE_SHOW_ATTRIBUTE
Date: Wed, 31 Mar 2021 14:53:25 +0800 [thread overview]
Message-ID: <20210331065326.18804-1-dingsenjie@163.com> (raw)
From: dingsenjie <dingsenjie@yulong.com>
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: dingsenjie <dingsenjie@yulong.com>
---
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 4471c4c..3aeee85 100644
--- a/drivers/scsi/snic/snic_debugfs.c
+++ b/drivers/scsi/snic/snic_debugfs.c
@@ -334,25 +334,7 @@ void snic_debugfs_init(void)
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,
--
1.9.1
next reply other threads:[~2021-03-31 6:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-31 6:53 dingsenjie [this message]
2021-04-16 2:51 ` [PATCH] scsi: snic: Convert to DEFINE_SHOW_ATTRIBUTE Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210331065326.18804-1-dingsenjie@163.com \
--to=dingsenjie@163.com \
--cc=dingsenjie@yulong.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).