linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] scsi: snic: convert to use DEFINE_SEQ_ATTRIBUTE macro
@ 2020-09-16  2:50 Liu Shixin
  2020-10-03  2:04 ` Martin K. Petersen
  2020-10-07  3:47 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Liu Shixin @ 2020-09-16  2:50 UTC (permalink / raw)
  To: Karan Tilak Kumar, Sesidhar Baddela, James E . J . Bottomley,
	Martin K . Petersen
  Cc: linux-scsi, linux-kernel, Liu Shixin

Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] scsi: snic: convert to use DEFINE_SEQ_ATTRIBUTE macro
  2020-09-16  2:50 [PATCH -next] scsi: snic: convert to use DEFINE_SEQ_ATTRIBUTE macro Liu Shixin
@ 2020-10-03  2:04 ` Martin K. Petersen
  2020-10-07  3:47 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2020-10-03  2:04 UTC (permalink / raw)
  To: Liu Shixin
  Cc: Karan Tilak Kumar, Sesidhar Baddela, James E . J . Bottomley,
	Martin K . Petersen, linux-scsi, linux-kernel


Liu,

> Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.

Applied to 5.10/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] scsi: snic: convert to use DEFINE_SEQ_ATTRIBUTE macro
  2020-09-16  2:50 [PATCH -next] scsi: snic: convert to use DEFINE_SEQ_ATTRIBUTE macro Liu Shixin
  2020-10-03  2:04 ` Martin K. Petersen
@ 2020-10-07  3:47 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2020-10-07  3:47 UTC (permalink / raw)
  To: Sesidhar Baddela, James E . J . Bottomley, Liu Shixin, Karan Tilak Kumar
  Cc: Martin K . Petersen, linux-kernel, linux-scsi

On Wed, 16 Sep 2020 10:50:30 +0800, Liu Shixin wrote:

> Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.

Applied to 5.10/scsi-queue, thanks!

[1/1] scsi: snic: Convert to use DEFINE_SEQ_ATTRIBUTE macro
      https://git.kernel.org/mkp/scsi/c/936dc95d09d8

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-07  3:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16  2:50 [PATCH -next] scsi: snic: convert to use DEFINE_SEQ_ATTRIBUTE macro Liu Shixin
2020-10-03  2:04 ` Martin K. Petersen
2020-10-07  3:47 ` Martin K. Petersen

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).