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]
Message-Id: <20200413030129.861-2-c.cantanheide@gmail.com>
Date:   Mon, 13 Apr 2020 03:01:29 +0000
From:   Camylla Goncalves Cantanheide <c.cantanheide@...il.com>
To:     gregkh@...uxfoundation.org, navid.emamdoost@...il.com,
        sylphrenadin@...il.com, nishkadg.linux@...il.com,
        stephen@...nnan.io, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org, lkcamp@...ts.libreplanetbr.org
Subject: [PATCH 2/2] staging: rtl8192u: Renames variables in setKey function

Renames the local variables of the setKey
function, making them explicit.

Signed-off-by: Camylla Goncalves Cantanheide <c.cantanheide@...il.com>
---
 drivers/staging/rtl8192u/r8192U_core.c | 48 +++++++++++++-------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 87c02aee3854..cc02c3b1eb91 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -4877,48 +4877,48 @@ void EnableHWSecurityConfig8192(struct net_device *dev)
 	write_nic_byte(dev, SECR,  SECR_value);
 }
 
-void setKey(struct net_device *dev, u8 entryno, u8 keyindex, u16 keytype,
-	    u8 *macaddr, u8 defaultkey, u32 *keycontent)
+void setKey(struct net_device *dev, u8 entry_no, u8 key_idx, u16 key_type,
+	    u8 *mac_addr, u8 default_key, u32 *key_content)
 {
-	u32 target_command = CAM_CONTENT_COUNT * entryno |  BIT(31) | BIT(16);
-	u32 target_content = 0;
-	u16 us_config = 0;
+	u32 cmd = CAM_CONTENT_COUNT * entry_no |  BIT(31) | BIT(16);
+	u32 content = 0;
+	u16 config = 0;
 	u8 i;
 
-	if (entryno >= TOTAL_CAM_ENTRY)
+	if (entry_no >= TOTAL_CAM_ENTRY)
 		RT_TRACE(COMP_ERR, "cam entry exceeds in %s\n", __func__);
 
 	RT_TRACE(COMP_SEC,
 		 "====>to %s, dev:%p, EntryNo:%d, KeyIndex:%d, KeyType:%d, MacAddr%pM\n",
-		 __func__, dev, entryno, keyindex, keytype, macaddr);
+		 __func__, dev, entry_no, key_idx, key_type, mac_addr);
 
-	if (defaultkey)
-		us_config |= BIT(15) | (keytype << 2);
+	if (default_key)
+		config |= BIT(15) | (key_type << 2);
 	else
-		us_config |= BIT(15) | (keytype << 2) | keyindex;
+		config |= BIT(15) | (key_type << 2) | key_idx;
 
-	target_content = macaddr[0] << 16 |
-			 macaddr[0] << 24 |
-			(u32)us_config;
+	content = mac_addr[0] << 16 |
+		  mac_addr[0] << 24 |
+		 (u32)config;
 
-	write_nic_dword(dev, WCAMI, target_content);
-	write_nic_dword(dev, RWCAM, target_command++);
+	write_nic_dword(dev, WCAMI, content);
+	write_nic_dword(dev, RWCAM, cmd++);
 
 	/* MAC */
-	target_content = macaddr[2]	  |
-			 macaddr[3] <<  8 |
-			 macaddr[4] << 16 |
-			 macaddr[5] << 24;
-	write_nic_dword(dev, WCAMI, target_content);
-	write_nic_dword(dev, RWCAM, target_command++);
+	content = mac_addr[2]	    |
+		  mac_addr[3] <<  8 |
+		  mac_addr[4] << 16 |
+		  mac_addr[5] << 24;
+	write_nic_dword(dev, WCAMI, content);
+	write_nic_dword(dev, RWCAM, cmd++);
 
 	/* Key Material */
-	if (!keycontent)
+	if (!key_content)
 		return;
 
 	for (i = 2; i < CAM_CONTENT_COUNT; i++) {
-		write_nic_dword(dev, WCAMI, *keycontent++);
-		write_nic_dword(dev, RWCAM, target_command++);
+		write_nic_dword(dev, WCAMI, *key_content++);
+		write_nic_dword(dev, RWCAM, cmd++);
 	}
 }
 
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ