netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next 7/7] bnxt_en: Pass in sh parameter to bnxt_set_dflt_rings().
Date: Mon, 29 May 2017 19:06:10 -0400	[thread overview]
Message-ID: <1496099170-701-8-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1496099170-701-1-git-send-email-michael.chan@broadcom.com>

In the existing code, the local variable sh is hardcoded to true to
calculate default rings for shared ring configuration.  It is better
to have the caller determine the value of sh.

Reported-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 2c6af31..954758f 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -7567,10 +7567,9 @@ static int bnxt_get_dflt_rings(struct bnxt *bp, int *max_rx, int *max_tx,
 	return rc;
 }
 
-static int bnxt_set_dflt_rings(struct bnxt *bp)
+static int bnxt_set_dflt_rings(struct bnxt *bp, bool sh)
 {
 	int dflt_rings, max_rx_rings, max_tx_rings, rc;
-	bool sh = true;
 
 	if (sh)
 		bp->flags |= BNXT_FLAG_SHARED_RINGS;
@@ -7749,7 +7748,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	bnxt_set_tpa_flags(bp);
 	bnxt_set_ring_params(bp);
 	bnxt_set_max_func_irqs(bp, max_irqs);
-	rc = bnxt_set_dflt_rings(bp);
+	rc = bnxt_set_dflt_rings(bp, true);
 	if (rc) {
 		netdev_err(bp->dev, "Not enough rings available.\n");
 		rc = -ENOMEM;
-- 
1.8.3.1

  parent reply	other threads:[~2017-05-29 23:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29 23:06 [PATCH net-next 0/7] bnxt_en: Misc. updates for net-next Michael Chan
2017-05-29 23:06 ` [PATCH net-next 1/7] bnxt_en: Support for Short Firmware Message Michael Chan
2017-05-29 23:06 ` [PATCH net-next 2/7] bnxt_en: Add PCI IDs for BCM57454 VF devices Michael Chan
2017-05-29 23:06 ` [PATCH net-next 3/7] bnxt_en: Add a callback to inform RDMA driver during PCI shutdown Michael Chan
2017-05-29 23:06 ` [PATCH net-next 4/7] bnxt_en: Add additional chip ID definitions Michael Chan
2017-05-29 23:06 ` [PATCH net-next 5/7] bnxt_en: Optimize doorbell write operations for newer chips Michael Chan
2017-05-29 23:06 ` [PATCH net-next 6/7] bnxt_en: Implement xmit_more Michael Chan
2017-05-30  3:28   ` Mintz, Yuval
2017-05-30  3:49     ` Michael Chan
2017-05-29 23:06 ` Michael Chan [this message]
2017-05-30  3:24 ` [PATCH net-next 0/7] bnxt_en: Misc. updates for net-next David Miller
2017-05-30  3:45   ` Michael Chan

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=1496099170-701-8-git-send-email-michael.chan@broadcom.com \
    --to=michael.chan@broadcom.com \
    --cc=davem@davemloft.net \
    --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;
as well as URLs for NNTP newsgroup(s).