All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH S37 v2 13/15] ice: Cleanup ice_vsi_alloc_q_vectors
Date: Fri, 31 Jan 2020 05:39:03 -0800	[thread overview]
Message-ID: <20200131133905.42518-13-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20200131133905.42518-1-anthony.l.nguyen@intel.com>

From: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>

1. Remove local variable num_q_vectors and use vsi->num_q_vectors instead
2. Remove local variable pf and pass vsi->back to ice_pf_to_dev

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_base.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c
index 46f427a95056..81885efadc7a 100644
--- a/drivers/net/ethernet/intel/ice/ice_base.c
+++ b/drivers/net/ethernet/intel/ice/ice_base.c
@@ -503,20 +503,15 @@ int ice_vsi_ctrl_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx)
  */
 int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi)
 {
-	struct ice_pf *pf = vsi->back;
-	int v_idx = 0, num_q_vectors;
-	struct device *dev;
-	int err;
+	struct device *dev = ice_pf_to_dev(vsi->back);
+	int v_idx, err;
 
-	dev = ice_pf_to_dev(pf);
 	if (vsi->q_vectors[0]) {
 		dev_dbg(dev, "VSI %d has existing q_vectors\n", vsi->vsi_num);
 		return -EEXIST;
 	}
 
-	num_q_vectors = vsi->num_q_vectors;
-
-	for (v_idx = 0; v_idx < num_q_vectors; v_idx++) {
+	for (v_idx = 0; v_idx < vsi->num_q_vectors; v_idx++) {
 		err = ice_vsi_alloc_q_vector(vsi, v_idx);
 		if (err)
 			goto err_out;
-- 
2.20.1


  parent reply	other threads:[~2020-01-31 13:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-31 13:38 [Intel-wired-lan] [PATCH S37 v2 01/15] ice: Fix DCB rebuild after reset Tony Nguyen
2020-01-31 13:38 ` [Intel-wired-lan] [PATCH S37 v2 02/15] ice: Fix switch between FW and SW LLDP Tony Nguyen
2020-01-31 13:38 ` [Intel-wired-lan] [PATCH S37 v2 03/15] ice: display supported and advertised link modes Tony Nguyen
2020-01-31 13:38 ` [Intel-wired-lan] [PATCH S37 v2 04/15] ice: Don't allow same value for Rx tail to be written twice Tony Nguyen
2020-01-31 13:38 ` [Intel-wired-lan] [PATCH S37 v2 05/15] ice: Remove ice_dev_onetime_setup() Tony Nguyen
2020-01-31 13:38 ` [Intel-wired-lan] [PATCH S37 v2 06/15] ice: Remove CONFIG_PCI_IOV wrap in ice_set_pf_caps Tony Nguyen
2020-01-31 13:38 ` [Intel-wired-lan] [PATCH S37 v2 07/15] ice: Modify link message logging Tony Nguyen
2020-01-31 13:38 ` [Intel-wired-lan] [PATCH S37 v2 08/15] ice: fix and consolidate logging of NVM/firmware version information Tony Nguyen
2020-01-31 13:38 ` [Intel-wired-lan] [PATCH S37 v2 09/15] ice: update Unit Load Status bitmask to check after reset Tony Nguyen
2020-01-31 13:39 ` [Intel-wired-lan] [PATCH S37 v2 10/15] ice: Remove possible null dereference Tony Nguyen
2020-01-31 13:39 ` [Intel-wired-lan] [PATCH S37 v2 11/15] ice: Use ice_pf_to_dev Tony Nguyen
2020-01-31 13:39 ` [Intel-wired-lan] [PATCH S37 v2 12/15] ice: Make print statements more compact Tony Nguyen
2020-01-31 13:39 ` Tony Nguyen [this message]
2020-01-31 13:39 ` [Intel-wired-lan] [PATCH S37 v2 14/15] ice: Use correct netif error function Tony Nguyen
2020-01-31 13:39 ` [Intel-wired-lan] [PATCH S37 v2 15/15] ice: Trivial fixes Tony Nguyen
2020-02-04 17:17 ` [Intel-wired-lan] [PATCH S37 v2 01/15] ice: Fix DCB rebuild after reset Allan, Bruce W
2020-02-04 17:56   ` Nguyen, Anthony L
2020-02-04 18:47     ` Allan, Bruce W

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=20200131133905.42518-13-anthony.l.nguyen@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@osuosl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.