lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed,  8 Apr 2009 11:13:58 +0300
From:	Pekka Enberg <penberg@...helsinki.fi>
To:	greg@...ah.com
Cc:	linux-kernel@...r.kernel.org, Pavel Machek <pavel@....cz>
Subject: [PATCH 03/11] w35und: simplify error handling in wb35_hw_init()

Impact: cleanup

Change hal_init_hardware() to return an error code rather than a boolean
to simplify error handling in wb35_hw_init().

Cc: Pavel Machek <pavel@....cz>
Signed-off-by: Pekka Enberg <penberg@...helsinki.fi>
---
 drivers/staging/winbond/wbusb.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/winbond/wbusb.c b/drivers/staging/winbond/wbusb.c
index a035c8c..1943ff0 100644
--- a/drivers/staging/winbond/wbusb.c
+++ b/drivers/staging/winbond/wbusb.c
@@ -476,7 +476,7 @@ static void hal_led_control(unsigned long data)
 	add_timer(&pHwData->LEDTimer);
 }
 
-static u8 hal_init_hardware(struct ieee80211_hw *hw)
+static int hal_init_hardware(struct ieee80211_hw *hw)
 {
 	struct wbsoft_priv *priv = hw->priv;
 	struct hw_data * pHwData = &priv->sHwData;
@@ -514,13 +514,13 @@ static u8 hal_init_hardware(struct ieee80211_hw *hw)
 				Wb35Rx_start(hw);
 				Wb35Tx_EP2VM_start(priv);
 
-				return true;
+				return 0;
 			}
 		}
 	}
 
 	pHwData->SurpriseRemove = 1;
-	return false;
+	return -EINVAL;
 }
 
 static int wb35_hw_init(struct ieee80211_hw *hw)
@@ -555,10 +555,9 @@ static int wb35_hw_init(struct ieee80211_hw *hw)
 
 	// Initial USB hal
 	pHwData = &priv->sHwData;
-	if (!hal_init_hardware(hw)) {
-		err = -EINVAL;
+	err = hal_init_hardware(hw);
+	if (err)
 		goto error;
-	}
 
 	EEPROM_region = hal_get_region_from_EEPROM( pHwData );
 	if (EEPROM_region != REGION_AUTO)
-- 
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ