Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATH iwl-next v2 1/1] e1000e: Minor flow correction in e1000_shutdown function
@ 2024-01-04 19:34 Vitaly Lifshits
  2024-02-14 10:31 ` naamax.meir
  0 siblings, 1 reply; 2+ messages in thread
From: Vitaly Lifshits @ 2024-01-04 19:34 UTC (permalink / raw)
  To: intel-wired-lan; +Cc: david.m.ertman, Vitaly Lifshits

Add curly braces to avoid entering to an if statement where it is not
always required in e1000_shutdown function.
This improves code readability and might prevent a non-deterministic
behaviour in the future.

Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
---
v2: fix commit message
v1: initial version
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index af5d9d97a0d6..cc8c531ec3df 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -6688,14 +6688,14 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)
 	if (adapter->hw.phy.type == e1000_phy_igp_3) {
 		e1000e_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw);
 	} else if (hw->mac.type >= e1000_pch_lpt) {
-		if (wufc && !(wufc & (E1000_WUFC_EX | E1000_WUFC_MC | E1000_WUFC_BC)))
+		if (wufc && !(wufc & (E1000_WUFC_EX | E1000_WUFC_MC | E1000_WUFC_BC))) {
 			/* ULP does not support wake from unicast, multicast
 			 * or broadcast.
 			 */
 			retval = e1000_enable_ulp_lpt_lp(hw, !runtime);
-
-		if (retval)
-			return retval;
+			if (retval)
+				return retval;
+		}
 	}
 
 	/* Ensure that the appropriate bits are set in LPI_CTRL
-- 
2.34.1


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

* Re: [Intel-wired-lan] [PATH iwl-next v2 1/1] e1000e: Minor flow correction in e1000_shutdown function
  2024-01-04 19:34 [Intel-wired-lan] [PATH iwl-next v2 1/1] e1000e: Minor flow correction in e1000_shutdown function Vitaly Lifshits
@ 2024-02-14 10:31 ` naamax.meir
  0 siblings, 0 replies; 2+ messages in thread
From: naamax.meir @ 2024-02-14 10:31 UTC (permalink / raw)
  To: Vitaly Lifshits, intel-wired-lan; +Cc: david.m.ertman

On 1/4/2024 21:34, Vitaly Lifshits wrote:
> Add curly braces to avoid entering to an if statement where it is not
> always required in e1000_shutdown function.
> This improves code readability and might prevent a non-deterministic
> behaviour in the future.
> 
> Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
> ---
> v2: fix commit message
> v1: initial version
> ---
>   drivers/net/ethernet/intel/e1000e/netdev.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)

Tested-by: Naama Meir <naamax.meir@linux.intel.com>

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

end of thread, other threads:[~2024-02-14 10:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-04 19:34 [Intel-wired-lan] [PATH iwl-next v2 1/1] e1000e: Minor flow correction in e1000_shutdown function Vitaly Lifshits
2024-02-14 10:31 ` naamax.meir

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox