From patchwork Thu Mar 1 23:37:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 880176 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="Gc+/7xDU"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zspmJ3C3Wz9s75 for ; Fri, 2 Mar 2018 10:38:56 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163268AbeCAXiw (ORCPT ); Thu, 1 Mar 2018 18:38:52 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:53645 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163380AbeCAXhf (ORCPT ); Thu, 1 Mar 2018 18:37:35 -0500 Received: by mail-wm0-f68.google.com with SMTP id t74so40188wme.3 for ; Thu, 01 Mar 2018 15:37:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=U7tLCOPLnLzb758qwLG9OozSl5izpW+z5RIEPT8+T7w=; b=Gc+/7xDUcDExyNMMAJhqeLR/LPROAxeJum+OYT3PwHIQ1+ldANp3PZW5Ic7MrSNwxM aRhTC0DtBJcSaT9N450Adv8sDWQfxWVmjSjRCKtcnSkjsdW3WGqJrooEjiEngi3jQk5Q Q1/KB9GQm3Oll9sccRKDM5+gczs2Xjh70l/h4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=U7tLCOPLnLzb758qwLG9OozSl5izpW+z5RIEPT8+T7w=; b=APRsqvwgytwqd26VlTkKbdPH3ITPswWpD5OoBu0s2YzLRWZez453R4tHePpQNeCnB3 UmIH6Cenq1bj2DI5HiYNwdufoc0nCKmo5mVKll1Hy0RlzZmq/VqTCl44ItSV8KJo7JK8 dUXZYyouQ/c16iNuZBu2jU3ehHZsYrL9aXl1objuBcQW4xCsUOjQoi6lRRc/aEcQyXVa XulaIith+V4zSkYvyFYcQxNiBnulAiBDx5C1p/sOsCOmF3Hz7hVynKiHOBzeJGMqrtxq nAxdkWI9rbNh13tGIqTOZkO/2CVDr3XEPUcJ0RX+rimtLGJm/qibiMS8oeaMKW3Hrz9T WSDA== X-Gm-Message-State: APf1xPDfIzB2HICxxo5CEtYNdWK3+PBAiiP/jVAKH0ls4SiWRuxBXUhh ioWjjUgl2FI8KxiqWuF9+QTy7Q== X-Google-Smtp-Source: AG47ELv1Ia6M5uP4C0J12hXevvznGx6ZekPs/Xaxk/+Bk7Vb8PMxSoEsE1Pg+U8fcr8anYBVDYER7Q== X-Received: by 10.80.146.180 with SMTP id k49mr4926376eda.110.1519947454171; Thu, 01 Mar 2018 15:37:34 -0800 (PST) Received: from prevas-ravi.waoo.dk (dhcp-5-186-126-104.cgn.ip.fibianet.dk. [5.186.126.104]) by smtp.gmail.com with ESMTPSA id e12sm4088274edi.29.2018.03.01.15.37.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Mar 2018 15:37:33 -0800 (PST) From: Rasmus Villemoes To: Jeff Kirsher Cc: Rasmus Villemoes , 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 Message-Id: <20180301233724.20440-4-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180301233724.20440-1-linux@rasmusvillemoes.dk> References: <20180301233724.20440-1-linux@rasmusvillemoes.dk> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Simplify the code slightly by having seq_open_data do the ->private assignment. Signed-off-by: Rasmus Villemoes --- 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 = {