netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] i40e: Two trivial fixes for 09f79fd49d94
@ 2017-09-06  8:11 Stefano Brivio
  2017-09-06  8:11 ` [PATCH net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word() Stefano Brivio
  2017-09-06  8:11 ` [PATCH net 2/2] i40e: Avoid some useless variables and initializers in nvm functions Stefano Brivio
  0 siblings, 2 replies; 5+ messages in thread
From: Stefano Brivio @ 2017-09-06  8:11 UTC (permalink / raw)
  To: Jeff Kirsher, netdev, intel-wired-lan
  Cc: David S . Miller, Anjali Singhai Jain

Two trivial fixes for recently introduced 09f79fd49d94 ("i40e: avoid NVM
acquire deadlock during NVM update"): 1/2 fixes a comment about locking
and 2/2 gets rid of two useless variables and one initializer in nvm
functions.

Stefano Brivio (2):
  i40e: Fix comment about locking for __i40e_read_nvm_word()
  i40e: Avoid some useless variables and initializers in nvm functions

 drivers/net/ethernet/intel/i40e/i40e_nvm.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

-- 
2.9.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word()
  2017-09-06  8:11 [PATCH net 0/2] i40e: Two trivial fixes for 09f79fd49d94 Stefano Brivio
@ 2017-09-06  8:11 ` Stefano Brivio
  2017-09-07  1:16   ` Jeff Kirsher
  2017-09-06  8:11 ` [PATCH net 2/2] i40e: Avoid some useless variables and initializers in nvm functions Stefano Brivio
  1 sibling, 1 reply; 5+ messages in thread
From: Stefano Brivio @ 2017-09-06  8:11 UTC (permalink / raw)
  To: Jeff Kirsher, netdev, intel-wired-lan
  Cc: David S . Miller, Anjali Singhai Jain

Caller needs to acquire the lock. Called functions will not.

Fixes: 09f79fd49d94 ("i40e: avoid NVM acquire deadlock during NVM update")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
---
 drivers/net/ethernet/intel/i40e/i40e_nvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
index 26d7e9fe6220..200779d5c124 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
@@ -281,7 +281,7 @@ static i40e_status i40e_read_nvm_word_aq(struct i40e_hw *hw, u16 offset,
 }
 
 /**
- * __i40e_read_nvm_word - Reads nvm word, assumes called does the locking
+ * __i40e_read_nvm_word - Reads nvm word, assumes caller does the locking
  * @hw: pointer to the HW structure
  * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF)
  * @data: word read from the Shadow RAM
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net 2/2] i40e: Avoid some useless variables and initializers in nvm functions
  2017-09-06  8:11 [PATCH net 0/2] i40e: Two trivial fixes for 09f79fd49d94 Stefano Brivio
  2017-09-06  8:11 ` [PATCH net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word() Stefano Brivio
@ 2017-09-06  8:11 ` Stefano Brivio
  2017-09-07  1:13   ` Jeff Kirsher
  1 sibling, 1 reply; 5+ messages in thread
From: Stefano Brivio @ 2017-09-06  8:11 UTC (permalink / raw)
  To: Jeff Kirsher, netdev, intel-wired-lan
  Cc: David S . Miller, Anjali Singhai Jain

Fixes: 09f79fd49d94 ("i40e: avoid NVM acquire deadlock during NVM update")
Signed-off-by: Stefano Brivio <sbrivio@redhat.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 200779d5c124..4a8a81cd3e32 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
@@ -294,13 +294,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);
 }
 
 /**
@@ -314,7 +311,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)
@@ -429,13 +426,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.9.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net 2/2] i40e: Avoid some useless variables and initializers in nvm functions
  2017-09-06  8:11 ` [PATCH net 2/2] i40e: Avoid some useless variables and initializers in nvm functions Stefano Brivio
@ 2017-09-07  1:13   ` Jeff Kirsher
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff Kirsher @ 2017-09-07  1:13 UTC (permalink / raw)
  To: Stefano Brivio, netdev, intel-wired-lan
  Cc: David S . Miller, Anjali Singhai Jain

[-- Attachment #1: Type: text/plain, Size: 571 bytes --]

On Wed, 2017-09-06 at 10:11 +0200, Stefano Brivio wrote:
> Fixes: 09f79fd49d94 ("i40e: avoid NVM acquire deadlock during NVM
> update")
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_nvm.c | 20 +++++++-------------
>  1 file changed, 7 insertions(+), 13 deletions(-)

This is NOT a fix, it is a coding style preference whether or not you
like multiple returns or a single return in functions.  I do not mind
picking this up for net-next (4.15 kernel), but this does not qualify
for a fix for Dave's net tree.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word()
  2017-09-06  8:11 ` [PATCH net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word() Stefano Brivio
@ 2017-09-07  1:16   ` Jeff Kirsher
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff Kirsher @ 2017-09-07  1:16 UTC (permalink / raw)
  To: Stefano Brivio, netdev, intel-wired-lan
  Cc: David S . Miller, Anjali Singhai Jain

[-- Attachment #1: Type: text/plain, Size: 663 bytes --]

On Wed, 2017-09-06 at 10:11 +0200, Stefano Brivio wrote:
> Caller needs to acquire the lock. Called functions will not.
> 
> Fixes: 09f79fd49d94 ("i40e: avoid NVM acquire deadlock during NVM
> update")
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_nvm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Yes, this fixes the function header comment, not sure if it requires
the "Fixes:" tag.  If that were the case, wonder why all the other code
comment changes do not have this. :-)  I do agree it reads better with
this change, so I do not have an issue queue this up for Dave's net
tree.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-07  1:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-06  8:11 [PATCH net 0/2] i40e: Two trivial fixes for 09f79fd49d94 Stefano Brivio
2017-09-06  8:11 ` [PATCH net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word() Stefano Brivio
2017-09-07  1:16   ` Jeff Kirsher
2017-09-06  8:11 ` [PATCH net 2/2] i40e: Avoid some useless variables and initializers in nvm functions Stefano Brivio
2017-09-07  1:13   ` Jeff Kirsher

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).