diff mbox

[net-next,4/7] e1000e: use true/false for bool autoneg_false

Message ID 1328783282-17760-5-git-send-email-jeffrey.t.kirsher@intel.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Kirsher, Jeffrey T Feb. 9, 2012, 10:27 a.m. UTC
From: Bruce Allan <bruce.w.allan@intel.com>

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000e/mac.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

Comments

David Laight Feb. 9, 2012, 1:15 p.m. UTC | #1
> -		if (mac->autoneg_failed == 0) {
> -			mac->autoneg_failed = 1;
> +		if (mac->autoneg_failed == false) {
> +			mac->autoneg_failed = true;

Don't check for equality with true/false.
Booleans also work better if you avoid double-negatives.

	David


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Feb. 9, 2012, 6:34 p.m. UTC | #2
From: "David Laight" <David.Laight@ACULAB.COM>
Date: Thu, 9 Feb 2012 13:15:37 -0000

>  
>> -		if (mac->autoneg_failed == 0) {
>> -			mac->autoneg_failed = 1;
>> +		if (mac->autoneg_failed == false) {
>> +			mac->autoneg_failed = true;
> 
> Don't check for equality with true/false.
> Booleans also work better if you avoid double-negatives.

Agreed.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c
index 0d63c3e..a5eb0d4 100644
--- a/drivers/net/ethernet/intel/e1000e/mac.c
+++ b/drivers/net/ethernet/intel/e1000e/mac.c
@@ -513,8 +513,8 @@  s32 e1000e_check_for_fiber_link(struct e1000_hw *hw)
 	/* (ctrl & E1000_CTRL_SWDPIN1) == 1 == have signal */
 	if ((ctrl & E1000_CTRL_SWDPIN1) && !(status & E1000_STATUS_LU) &&
 	    !(rxcw & E1000_RXCW_C)) {
-		if (mac->autoneg_failed == 0) {
-			mac->autoneg_failed = 1;
+		if (mac->autoneg_failed == false) {
+			mac->autoneg_failed = true;
 			return 0;
 		}
 		e_dbg("NOT Rx'ing /C/, disable AutoNeg and force link.\n");
@@ -578,8 +578,8 @@  s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
 	 */
 	/* (ctrl & E1000_CTRL_SWDPIN1) == 1 == have signal */
 	if (!(status & E1000_STATUS_LU) && !(rxcw & E1000_RXCW_C)) {
-		if (mac->autoneg_failed == 0) {
-			mac->autoneg_failed = 1;
+		if (mac->autoneg_failed == false) {
+			mac->autoneg_failed = true;
 			return 0;
 		}
 		e_dbg("NOT Rx'ing /C/, disable AutoNeg and force link.\n");
@@ -855,7 +855,7 @@  static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw)
 	}
 	if (i == FIBER_LINK_UP_LIMIT) {
 		e_dbg("Never got a valid link from auto-neg!!!\n");
-		mac->autoneg_failed = 1;
+		mac->autoneg_failed = true;
 		/*
 		 * AutoNeg failed to achieve a link, so we'll call
 		 * mac->check_for_link. This routine will force the
@@ -867,9 +867,9 @@  static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw)
 			e_dbg("Error while checking for link\n");
 			return ret_val;
 		}
-		mac->autoneg_failed = 0;
+		mac->autoneg_failed = false;
 	} else {
-		mac->autoneg_failed = 0;
+		mac->autoneg_failed = false;
 		e_dbg("Valid Link Found\n");
 	}