From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Stefano Brivio <sbrivio@redhat.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 14/14] i40e: Avoid some useless variables and initializers in NVM functions
Date: Mon, 9 Oct 2017 15:38:41 -0700 [thread overview]
Message-ID: <20171009223841.2557-15-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20171009223841.2557-1-jeffrey.t.kirsher@intel.com>
From: Stefano Brivio <sbrivio@redhat.com>
Fixes: 09f79fd49d94 ("i40e: avoid NVM acquire deadlock during NVM update")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_nvm.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
index 57505b1df98d..151d9cfb6ea4 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
@@ -311,13 +311,10 @@ static i40e_status i40e_read_nvm_word_aq(struct i40e_hw *hw, u16 offset,
static i40e_status __i40e_read_nvm_word(struct i40e_hw *hw,
u16 offset, u16 *data)
{
- i40e_status ret_code = 0;
-
if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE)
- ret_code = i40e_read_nvm_word_aq(hw, offset, data);
- else
- ret_code = i40e_read_nvm_word_srctl(hw, offset, data);
- return ret_code;
+ return i40e_read_nvm_word_aq(hw, offset, data);
+
+ return i40e_read_nvm_word_srctl(hw, offset, data);
}
/**
@@ -331,7 +328,7 @@ static i40e_status __i40e_read_nvm_word(struct i40e_hw *hw,
i40e_status i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,
u16 *data)
{
- i40e_status ret_code = 0;
+ i40e_status ret_code;
ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
if (ret_code)
@@ -446,13 +443,10 @@ static i40e_status __i40e_read_nvm_buffer(struct i40e_hw *hw,
u16 offset, u16 *words,
u16 *data)
{
- i40e_status ret_code = 0;
-
if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE)
- ret_code = i40e_read_nvm_buffer_aq(hw, offset, words, data);
- else
- ret_code = i40e_read_nvm_buffer_srctl(hw, offset, words, data);
- return ret_code;
+ return i40e_read_nvm_buffer_aq(hw, offset, words, data);
+
+ return i40e_read_nvm_buffer_srctl(hw, offset, words, data);
}
/**
--
2.14.2
next prev parent reply other threads:[~2017-10-09 22:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-09 22:38 [net-next 00/14][pull request] 40GbE Intel Wired LAN Driver Updates 2017-10-09 Jeff Kirsher
2017-10-09 22:38 ` [net-next 01/14] i40e: fix flags declaration Jeff Kirsher
2017-10-09 22:38 ` [net-next 02/14] i40e: use the safe hash table iterator when deleting mac filters Jeff Kirsher
2017-10-09 22:38 ` [net-next 03/14] i40evf: fix mac filter removal timing issue Jeff Kirsher
2017-10-09 22:38 ` [net-next 04/14] i40e/i40evf: fix incorrect default ITR values on driver load Jeff Kirsher
2017-10-09 22:38 ` [net-next 05/14] i40e/i40evf: always set the CLEARPBA flag when re-enabling interrupts Jeff Kirsher
2017-10-10 13:07 ` David Laight
2017-10-09 22:38 ` [net-next 06/14] i40e: reduce lrxqthresh from 2 to 1 Jeff Kirsher
2017-10-09 22:38 ` [net-next 07/14] i40e/i40evf: bump tail only in multiples of 8 Jeff Kirsher
2017-10-09 22:38 ` [net-next 08/14] i40e/i40evf: bundle more descriptors when allocating buffers Jeff Kirsher
2017-10-09 22:38 ` [net-next 09/14] i40e: allow XPS with QoS enabled Jeff Kirsher
2017-10-09 22:38 ` [net-next 10/14] i40e: add check for return from find_first_bit call Jeff Kirsher
2017-10-09 22:38 ` [net-next 11/14] i40e: Retry AQC GetPhyAbilities to overcome I2CRead hangs Jeff Kirsher
2017-10-09 22:38 ` [net-next 12/14] i40e: use a local variable instead of calculating multiple times Jeff Kirsher
2017-10-09 22:38 ` [net-next 13/14] i40e: fix a typo Jeff Kirsher
2017-10-09 22:38 ` Jeff Kirsher [this message]
2017-10-10 1:12 ` [net-next 00/14][pull request] 40GbE Intel Wired LAN Driver Updates 2017-10-09 David Miller
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=20171009223841.2557-15-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=jogreene@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.com \
--cc=sbrivio@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