mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [RFC 4/5] fm10k: use seq_open_data()
Date: Fri,  2 Mar 2018 00:37:23 +0100	[thread overview]
Message-ID: <20180301233724.20440-4-linux@rasmusvillemoes.dk> (raw)
In-Reply-To: <20180301233724.20440-1-linux@rasmusvillemoes.dk>

Simplify the code slightly by having seq_open_data do the ->private assignment.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/net/ethernet/intel/fm10k/fm10k_debugfs.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_debugfs.c b/drivers/net/ethernet/intel/fm10k/fm10k_debugfs.c
index 14df09e2d964..acf034feb8fa 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_debugfs.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_debugfs.c
@@ -132,20 +132,13 @@ static int fm10k_dbg_desc_open(struct inode *inode, struct file *filep)
 	struct fm10k_ring *ring = inode->i_private;
 	struct fm10k_q_vector *q_vector = ring->q_vector;
 	const struct seq_operations *desc_seq_ops;
-	int err;
 
 	if (ring < q_vector->rx.ring)
 		desc_seq_ops = &fm10k_dbg_tx_desc_seq_ops;
 	else
 		desc_seq_ops = &fm10k_dbg_rx_desc_seq_ops;
 
-	err = seq_open(filep, desc_seq_ops);
-	if (err)
-		return err;
-
-	((struct seq_file *)filep->private_data)->private = ring;
-
-	return 0;
+	return seq_open_data(filep, desc_seq_ops, ring);
 }
 
 static const struct file_operations fm10k_dbg_desc_fops = {
-- 
2.15.1

  parent reply	other threads:[~2018-03-01 23:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01 23:37 [RFC 1/5] seq_file: introduce seq_open_data helper Rasmus Villemoes
2018-03-01 23:37 ` [RFC 2/5] ia64/sn/hwperf: use seq_open_data Rasmus Villemoes
2018-03-02  8:22   ` Rasmus Villemoes
2018-03-01 23:37 ` [RFC 3/5] powerpc/pseries: use seq_open_data in hcall_inst_seq_open Rasmus Villemoes
2018-03-01 23:37 ` Rasmus Villemoes [this message]
2018-03-01 23:37 ` [RFC 5/5] PCI: tegra: use seq_open_data Rasmus Villemoes
2018-03-02 10:42   ` Thierry Reding
2018-03-07 12:41     ` Lorenzo Pieralisi
2018-04-25  9:38       ` Lorenzo Pieralisi
2018-03-01 23:44 ` [RFC 1/5] seq_file: introduce seq_open_data helper Andreas Dilger

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=20180301233724.20440-4-linux@rasmusvillemoes.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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

Powered by JetHome