Commit 7949be66 authored by Bhaktipriya Shridhar's avatar Bhaktipriya Shridhar Committed by Greg Kroah-Hartman

staging: rtl8192e: Drop useless initialisation

Removed initialisation of a varible if it is immediately reassigned.

Changes were made using Coccinelle.

@@
type T;
constant C;
expression e;
identifier i;
@@
T i
- = C
;
i = e;
Signed-off-by: default avatarBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a4eed41f
...@@ -680,7 +680,7 @@ static void _rtl92e_hwconfig(struct net_device *dev) ...@@ -680,7 +680,7 @@ static void _rtl92e_hwconfig(struct net_device *dev)
rtl92e_writeb(dev, BW_OPMODE, regBwOpMode); rtl92e_writeb(dev, BW_OPMODE, regBwOpMode);
{ {
u32 ratr_value = 0; u32 ratr_value;
ratr_value = regRATR; ratr_value = regRATR;
if (priv->rf_type == RF_1T2R) if (priv->rf_type == RF_1T2R)
...@@ -1000,7 +1000,7 @@ void rtl92e_link_change(struct net_device *dev) ...@@ -1000,7 +1000,7 @@ void rtl92e_link_change(struct net_device *dev)
_rtl92e_update_msr(dev); _rtl92e_update_msr(dev);
if (ieee->iw_mode == IW_MODE_INFRA || ieee->iw_mode == IW_MODE_ADHOC) { if (ieee->iw_mode == IW_MODE_INFRA || ieee->iw_mode == IW_MODE_ADHOC) {
u32 reg = 0; u32 reg;
reg = rtl92e_readl(dev, RCR); reg = rtl92e_readl(dev, RCR);
if (priv->rtllib->state == RTLLIB_LINKED) { if (priv->rtllib->state == RTLLIB_LINKED) {
...@@ -1186,7 +1186,7 @@ void rtl92e_fill_tx_desc(struct net_device *dev, struct tx_desc *pdesc, ...@@ -1186,7 +1186,7 @@ void rtl92e_fill_tx_desc(struct net_device *dev, struct tx_desc *pdesc,
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
dma_addr_t mapping = pci_map_single(priv->pdev, skb->data, skb->len, dma_addr_t mapping = pci_map_single(priv->pdev, skb->data, skb->len,
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
struct tx_fwinfo_8190pci *pTxFwInfo = NULL; struct tx_fwinfo_8190pci *pTxFwInfo;
pTxFwInfo = (struct tx_fwinfo_8190pci *)skb->data; pTxFwInfo = (struct tx_fwinfo_8190pci *)skb->data;
memset(pTxFwInfo, 0, sizeof(struct tx_fwinfo_8190pci)); memset(pTxFwInfo, 0, sizeof(struct tx_fwinfo_8190pci));
...@@ -2235,7 +2235,7 @@ void rtl92e_disable_irq(struct net_device *dev) ...@@ -2235,7 +2235,7 @@ void rtl92e_disable_irq(struct net_device *dev)
void rtl92e_clear_irq(struct net_device *dev) void rtl92e_clear_irq(struct net_device *dev)
{ {
u32 tmp = 0; u32 tmp;
tmp = rtl92e_readl(dev, ISR); tmp = rtl92e_readl(dev, ISR);
rtl92e_writel(dev, ISR, tmp); rtl92e_writel(dev, ISR, tmp);
......
...@@ -1875,7 +1875,7 @@ void rtl92e_dm_rf_pathcheck_wq(void *data) ...@@ -1875,7 +1875,7 @@ void rtl92e_dm_rf_pathcheck_wq(void *data)
struct r8192_priv, struct r8192_priv,
rfpath_check_wq); rfpath_check_wq);
struct net_device *dev = priv->rtllib->dev; struct net_device *dev = priv->rtllib->dev;
u8 rfpath = 0, i; u8 rfpath, i;
rfpath = rtl92e_readb(dev, 0xc04); rfpath = rtl92e_readb(dev, 0xc04);
......
...@@ -189,7 +189,7 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, ...@@ -189,7 +189,7 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst,
static void rtllib_send_ADDBAReq(struct rtllib_device *ieee, u8 *dst, static void rtllib_send_ADDBAReq(struct rtllib_device *ieee, u8 *dst,
struct ba_record *pBA) struct ba_record *pBA)
{ {
struct sk_buff *skb = NULL; struct sk_buff *skb;
skb = rtllib_ADDBA(ieee, dst, pBA, 0, ACT_ADDBAREQ); skb = rtllib_ADDBA(ieee, dst, pBA, 0, ACT_ADDBAREQ);
...@@ -204,7 +204,7 @@ static void rtllib_send_ADDBAReq(struct rtllib_device *ieee, u8 *dst, ...@@ -204,7 +204,7 @@ static void rtllib_send_ADDBAReq(struct rtllib_device *ieee, u8 *dst,
static void rtllib_send_ADDBARsp(struct rtllib_device *ieee, u8 *dst, static void rtllib_send_ADDBARsp(struct rtllib_device *ieee, u8 *dst,
struct ba_record *pBA, u16 StatusCode) struct ba_record *pBA, u16 StatusCode)
{ {
struct sk_buff *skb = NULL; struct sk_buff *skb;
skb = rtllib_ADDBA(ieee, dst, pBA, StatusCode, ACT_ADDBARSP); skb = rtllib_ADDBA(ieee, dst, pBA, StatusCode, ACT_ADDBARSP);
if (skb) if (skb)
...@@ -217,7 +217,7 @@ static void rtllib_send_DELBA(struct rtllib_device *ieee, u8 *dst, ...@@ -217,7 +217,7 @@ static void rtllib_send_DELBA(struct rtllib_device *ieee, u8 *dst,
struct ba_record *pBA, enum tr_select TxRxSelect, struct ba_record *pBA, enum tr_select TxRxSelect,
u16 ReasonCode) u16 ReasonCode)
{ {
struct sk_buff *skb = NULL; struct sk_buff *skb;
skb = rtllib_DELBA(ieee, dst, pBA, TxRxSelect, ReasonCode); skb = rtllib_DELBA(ieee, dst, pBA, TxRxSelect, ReasonCode);
if (skb) if (skb)
......
...@@ -905,7 +905,7 @@ static size_t rtllib_rx_get_hdrlen(struct rtllib_device *ieee, ...@@ -905,7 +905,7 @@ static size_t rtllib_rx_get_hdrlen(struct rtllib_device *ieee,
{ {
struct rtllib_hdr_4addr *hdr = (struct rtllib_hdr_4addr *)skb->data; struct rtllib_hdr_4addr *hdr = (struct rtllib_hdr_4addr *)skb->data;
u16 fc = le16_to_cpu(hdr->frame_ctl); u16 fc = le16_to_cpu(hdr->frame_ctl);
size_t hdrlen = 0; size_t hdrlen;
hdrlen = rtllib_get_hdrlen(fc); hdrlen = rtllib_get_hdrlen(fc);
if (HTCCheck(ieee, skb->data)) { if (HTCCheck(ieee, skb->data)) {
......
...@@ -776,7 +776,7 @@ inline struct sk_buff *rtllib_authentication_req(struct rtllib_network *beacon, ...@@ -776,7 +776,7 @@ inline struct sk_buff *rtllib_authentication_req(struct rtllib_network *beacon,
{ {
struct sk_buff *skb; struct sk_buff *skb;
struct rtllib_authentication *auth; struct rtllib_authentication *auth;
int len = 0; int len;
len = sizeof(struct rtllib_authentication) + challengelen + len = sizeof(struct rtllib_authentication) + challengelen +
ieee->tx_headroom + 4; ieee->tx_headroom + 4;
......
...@@ -243,7 +243,7 @@ int rtllib_wx_get_rate(struct rtllib_device *ieee, ...@@ -243,7 +243,7 @@ int rtllib_wx_get_rate(struct rtllib_device *ieee,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
u32 tmp_rate = 0; u32 tmp_rate;
tmp_rate = TxCountToDataRate(ieee, tmp_rate = TxCountToDataRate(ieee,
ieee->softmac_stats.CurrentShowTxate); ieee->softmac_stats.CurrentShowTxate);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment