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-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0810292010330.16596@melkki.cs.Helsinki.FI>
Date:	Wed, 29 Oct 2008 20:10:55 +0200 (EET)
From:	Pekka J Enberg <penberg@...helsinki.fi>
To:	Greg Kroah-Hartman <greg@...ah.com>
cc:	Pavel Machek <pavel@...e.cz>, linux-kernel@...r.kernel.org
Subject: [PATCH 3/6] w35und: remove memcpy/memcmp wrappers

From: Pekka Enberg <penberg@...helsinki.fi>

The OS_MEMORY_CLEAR macro is not used so remove it. Also convert the one
call-site that uses OS_MEMORY_COMPARE to use memcmp() directly and remove the
wrapper macro.

Cc: Pavel Machek <pavel@...e.cz>
Signed-off-by: Pekka Enberg <penberg@...helsinki.fi>
---
 drivers/staging/winbond/linux/common.h |    3 ---
 drivers/staging/winbond/wblinux.c      |    9 ++++-----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/winbond/linux/common.h b/drivers/staging/winbond/linux/common.h
index 925e1b6..046dab6 100644
--- a/drivers/staging/winbond/linux/common.h
+++ b/drivers/staging/winbond/linux/common.h
@@ -73,8 +73,5 @@
 #define OS_EVENT_INDICATE( _A, _B, _F )
 #define OS_PMKID_STATUS_EVENT( _A )
 
-#define OS_MEMORY_CLEAR( _A, _S )	memset( (u8 *)_A,0,_S)
-#define OS_MEMORY_COMPARE( _A, _B, _S )	(memcmp(_A,_B,_S)? 0 : 1) // Definition is reverse with Ndis 1: the same 0: different
-
 #endif // COMMON_DEF
 
diff --git a/drivers/staging/winbond/wblinux.c b/drivers/staging/winbond/wblinux.c
index 665d8e0..e43070e 100644
--- a/drivers/staging/winbond/wblinux.c
+++ b/drivers/staging/winbond/wblinux.c
@@ -181,12 +181,11 @@ WbWLanInitialize(struct wb35_adapter * adapter)
 	pMacAddr = adapter->sLocalPara.ThisMacAddress;
 	pMacAddr2 = adapter->sLocalPara.PermanentAddress;
 	hal_get_permanent_address( pHwData, adapter->sLocalPara.PermanentAddress );// Reading ethernet address from EEPROM
-	if (OS_MEMORY_COMPARE(pMacAddr, "\x00\x00\x00\x00\x00\x00", MAC_ADDR_LENGTH )) // Is equal
-	{
-		memcpy( pMacAddr, pMacAddr2, MAC_ADDR_LENGTH );
-	} else {
+	if (memcmp(pMacAddr, "\x00\x00\x00\x00\x00\x00", MAC_ADDR_LENGTH) == 0)
+		memcpy(pMacAddr, pMacAddr2, MAC_ADDR_LENGTH);
+	else {
 		// Set the user define MAC address
-		hal_set_ethernet_address( pHwData, adapter->sLocalPara.ThisMacAddress );
+		hal_set_ethernet_address(pHwData, adapter->sLocalPara.ThisMacAddress);
 	}
 
 	//get current antenna
-- 
1.5.3.7

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