All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] i40e: Two trivial fixes for 09f79fd49d94
@ 2017-09-06  8:11 ` Stefano Brivio
  0 siblings, 0 replies; 12+ 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] 12+ messages in thread

* [Intel-wired-lan] [PATCH net 0/2] i40e: Two trivial fixes for 09f79fd49d94
@ 2017-09-06  8:11 ` Stefano Brivio
  0 siblings, 0 replies; 12+ messages in thread
From: Stefano Brivio @ 2017-09-06  8:11 UTC (permalink / raw)
  To: intel-wired-lan

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] 12+ messages in thread

* [PATCH net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word()
  2017-09-06  8:11 ` [Intel-wired-lan] " Stefano Brivio
@ 2017-09-06  8:11   ` Stefano Brivio
  -1 siblings, 0 replies; 12+ 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] 12+ messages in thread

* [Intel-wired-lan] [PATCH net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word()
@ 2017-09-06  8:11   ` Stefano Brivio
  0 siblings, 0 replies; 12+ messages in thread
From: Stefano Brivio @ 2017-09-06  8:11 UTC (permalink / raw)
  To: intel-wired-lan

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] 12+ messages in thread

* [PATCH net 2/2] i40e: Avoid some useless variables and initializers in nvm functions
  2017-09-06  8:11 ` [Intel-wired-lan] " Stefano Brivio
@ 2017-09-06  8:11   ` Stefano Brivio
  -1 siblings, 0 replies; 12+ 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] 12+ messages in thread

* [Intel-wired-lan] [PATCH net 2/2] i40e: Avoid some useless variables and initializers in nvm functions
@ 2017-09-06  8:11   ` Stefano Brivio
  0 siblings, 0 replies; 12+ messages in thread
From: Stefano Brivio @ 2017-09-06  8:11 UTC (permalink / raw)
  To: intel-wired-lan

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] 12+ messages in thread

* Re: [PATCH net 2/2] i40e: Avoid some useless variables and initializers in nvm functions
  2017-09-06  8:11   ` [Intel-wired-lan] " Stefano Brivio
@ 2017-09-07  1:13     ` Jeff Kirsher
  -1 siblings, 0 replies; 12+ 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] 12+ messages in thread

* [Intel-wired-lan] [PATCH net 2/2] i40e: Avoid some useless variables and initializers in nvm functions
@ 2017-09-07  1:13     ` Jeff Kirsher
  0 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2017-09-07  1:13 UTC (permalink / raw)
  To: intel-wired-lan

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20170906/b948ff49/attachment.asc>

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

* Re: [PATCH net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word()
  2017-09-06  8:11   ` [Intel-wired-lan] " Stefano Brivio
@ 2017-09-07  1:16     ` Jeff Kirsher
  -1 siblings, 0 replies; 12+ 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] 12+ messages in thread

* [Intel-wired-lan] [PATCH net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word()
@ 2017-09-07  1:16     ` Jeff Kirsher
  0 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2017-09-07  1:16 UTC (permalink / raw)
  To: intel-wired-lan

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20170906/dcd1c398/attachment.asc>

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

* [Intel-wired-lan] [PATCH net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word()
  2017-09-06  8:11   ` [Intel-wired-lan] " Stefano Brivio
  (?)
  (?)
@ 2017-09-11 18:42   ` Bowers, AndrewX
  -1 siblings, 0 replies; 12+ messages in thread
From: Bowers, AndrewX @ 2017-09-11 18:42 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Stefano Brivio
> Sent: Wednesday, September 6, 2017 1:12 AM
> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>;
> netdev at vger.kernel.org; intel-wired-lan at lists.osuosl.org
> Cc: David S . Miller <davem@davemloft.net>
> Subject: [Intel-wired-lan] [PATCH net 1/2] i40e: Fix comment about locking
> for __i40e_read_nvm_word()
> 
> 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(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [PATCH net 2/2] i40e: Avoid some useless variables and initializers in nvm functions
  2017-09-06  8:11   ` [Intel-wired-lan] " Stefano Brivio
  (?)
  (?)
@ 2017-09-11 18:43   ` Bowers, AndrewX
  -1 siblings, 0 replies; 12+ messages in thread
From: Bowers, AndrewX @ 2017-09-11 18:43 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Stefano Brivio
> Sent: Wednesday, September 6, 2017 1:12 AM
> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>;
> netdev at vger.kernel.org; intel-wired-lan at lists.osuosl.org
> Cc: David S . Miller <davem@davemloft.net>
> Subject: [Intel-wired-lan] [PATCH net 2/2] i40e: Avoid some useless variables
> and initializers in nvm functions
> 
> 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(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

end of thread, other threads:[~2017-09-11 18:43 UTC | newest]

Thread overview: 12+ 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 ` [Intel-wired-lan] " 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   ` [Intel-wired-lan] " Stefano Brivio
2017-09-07  1:16   ` Jeff Kirsher
2017-09-07  1:16     ` [Intel-wired-lan] " Jeff Kirsher
2017-09-11 18:42   ` Bowers, AndrewX
2017-09-06  8:11 ` [PATCH net 2/2] i40e: Avoid some useless variables and initializers in nvm functions Stefano Brivio
2017-09-06  8:11   ` [Intel-wired-lan] " Stefano Brivio
2017-09-07  1:13   ` Jeff Kirsher
2017-09-07  1:13     ` [Intel-wired-lan] " Jeff Kirsher
2017-09-11 18:43   ` Bowers, AndrewX

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.