netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net, kuba@kernel.org
Cc: Kevin Lo <kevlo@kevlo.org>,
	netdev@vger.kernel.org, sassmann@redhat.com,
	anthony.l.nguyen@intel.com
Subject: [PATCH net 2/4] igc: set the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr
Date: Thu, 28 Jan 2021 13:38:49 -0800	[thread overview]
Message-ID: <20210128213851.2499012-3-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20210128213851.2499012-1-anthony.l.nguyen@intel.com>

From: Kevin Lo <kevlo@kevlo.org>

This patch sets the default return value to -IGC_ERR_NVM in
igc_write_nvm_srwr. Without this change it wouldn't lead to a shadow RAM
write EEWR timeout.

Fixes: ab4056126813 ("igc: Add NVM support")
Signed-off-by: Kevin Lo <kevlo@kevlo.org>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_i225.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_i225.c b/drivers/net/ethernet/intel/igc/igc_i225.c
index 8b67d9b49a83..7ec04e48860c 100644
--- a/drivers/net/ethernet/intel/igc/igc_i225.c
+++ b/drivers/net/ethernet/intel/igc/igc_i225.c
@@ -219,9 +219,9 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
 			      u16 *data)
 {
 	struct igc_nvm_info *nvm = &hw->nvm;
+	s32 ret_val = -IGC_ERR_NVM;
 	u32 attempts = 100000;
 	u32 i, k, eewr = 0;
-	s32 ret_val = 0;
 
 	/* A check for invalid values:  offset too large, too many words,
 	 * too many words for the offset, and not enough words.
@@ -229,7 +229,6 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
 	if (offset >= nvm->word_size || (words > (nvm->word_size - offset)) ||
 	    words == 0) {
 		hw_dbg("nvm parameter(s) out of bounds\n");
-		ret_val = -IGC_ERR_NVM;
 		goto out;
 	}
 
-- 
2.26.2


  parent reply	other threads:[~2021-01-28 21:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 21:38 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2021-01-28 Tony Nguyen
2021-01-28 21:38 ` [PATCH net 1/4] igc: Report speed and duplex as unknown when device is runtime suspended Tony Nguyen
2021-01-30  6:22   ` Jakub Kicinski
2021-01-30 14:00     ` Neftin, Sasha
2021-01-30 18:12       ` Jakub Kicinski
2021-01-31 10:22         ` Neftin, Sasha
2021-02-01 22:04           ` Jakub Kicinski
2021-01-28 21:38 ` Tony Nguyen [this message]
2021-01-28 21:38 ` [PATCH net 3/4] igc: check return value of ret_val in igc_config_fc_after_link_up Tony Nguyen
2021-01-28 21:38 ` [PATCH net 4/4] i40e: Revert "i40e: don't report link up for a VF who hasn't enabled queues" Tony Nguyen
2021-01-29 20:23   ` Willem de Bruijn
2021-01-30  0:09     ` Jacob Keller
2021-01-30  2:00       ` Willem de Bruijn
2021-01-30  6:18         ` Jakub Kicinski

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=20210128213851.2499012-3-anthony.l.nguyen@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=kevlo@kevlo.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    /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).