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>] [day] [month] [year] [list]
Message-Id: <1422715767-1805-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
Date:	Sat, 31 Jan 2015 15:49:27 +0100
From:	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Julia Lawall <Julia.Lawall@...6.fr>
Cc:	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>,
	Vaishali Thakkar <vthakkar1994@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Matthew Casey <mdcasey@...bloom.com>,
	Joe Perches <joe@...ches.com>,
	Joel Pelaez Jorge <joelpelaez@...il.com>,
	Dominique van den Broeck <domdevlin@...e.fr>,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH] staging: rtl8192e: rtl8192e: rtl_core: Removed variables that is never used

Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c |   25 ++++---------------------
 1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 5615c80..d6c1424 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -1369,24 +1369,12 @@ static enum reset_type rtl819x_TxCheckStuck(struct net_device *dev)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 	u8	QueueID;
-	u8	ResetThreshold = NIC_SEND_HANG_THRESHOLD_POWERSAVE;
 	bool	bCheckFwTxCnt = false;
 	struct rtl8192_tx_ring  *ring = NULL;
 	struct sk_buff *skb = NULL;
 	struct cb_desc *tcb_desc = NULL;
 	unsigned long flags = 0;
 
-	switch (priv->rtllib->ps) {
-	case RTLLIB_PS_DISABLED:
-		ResetThreshold = NIC_SEND_HANG_THRESHOLD_NORMAL;
-		break;
-	case (RTLLIB_PS_MBCAST|RTLLIB_PS_UNICAST):
-		ResetThreshold = NIC_SEND_HANG_THRESHOLD_POWERSAVE;
-		break;
-	default:
-		ResetThreshold = NIC_SEND_HANG_THRESHOLD_POWERSAVE;
-		break;
-	}
 	spin_lock_irqsave(&priv->irq_th_lock, flags);
 	for (QueueID = 0; QueueID < MAX_TX_QUEUE; QueueID++) {
 		if (QueueID == TXCMD_QUEUE)
@@ -2000,8 +1988,8 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 				    MAX_DEV_ADDR_SIZE);
 	struct tx_desc *pdesc = NULL;
 	struct rtllib_hdr_1addr *header = NULL;
-	u16 fc = 0, type = 0, stype = 0;
-	bool  multi_addr = false, broad_addr = false, uni_addr = false;
+	u16 fc = 0, type = 0;
+	bool  multi_addr = false, uni_addr = false;
 	u8 *pda_addr = NULL;
 	int   idx;
 	u32 fwinfo_size = 0;
@@ -2020,14 +2008,11 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 	header = (struct rtllib_hdr_1addr *)(((u8 *)skb->data) + fwinfo_size);
 	fc = le16_to_cpu(header->frame_ctl);
 	type = WLAN_FC_GET_TYPE(fc);
-	stype = WLAN_FC_GET_STYPE(fc);
 	pda_addr = header->addr1;
 
-	if (is_broadcast_ether_addr(pda_addr))
-		broad_addr = true;
-	else if (is_multicast_ether_addr(pda_addr))
+	if (is_multicast_ether_addr(pda_addr))
 		multi_addr = true;
-	else
+	else if (!is_broadcast_ether_addr(pda_addr))
 		uni_addr = true;
 
 	if (uni_addr)
@@ -3017,8 +3002,6 @@ static void rtl8192_pci_disconnect(struct pci_dev *pdev)
 			release_mem_region(pci_resource_start(pdev, 1),
 					pci_resource_len(pdev, 1));
 		}
-	} else {
-		priv = rtllib_priv(dev);
 	}
 
 	pci_disable_device(pdev);
-- 
1.7.10.4

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