Staging: rtl8192e: Remove unnecessary variables
Author: Cristina Opriceana <cristina.opriceana@gmail.com>
This patch removes unnecessary intermediary variables in return lines
and uses actual values.
Found by coccinelle using this semantic patch:
@@ type T; expression expr; identifier r; @@
-T r = expr;
... when != r
when strict
-return r;
+return expr;
Signed-off-by: Cristina Opriceana
Signed-off-by: Greg Kroah-Hartman
---
drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 3 +--
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +--
drivers/staging/rtl8192e/rtl819x_HTProc.c | 4 +---
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
index 6cb0326..fa9c081 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
@@ -36,7 +36,6 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
u32 buffer_len)
{
struct r8192_priv *priv = rtllib_priv(dev);
- bool rt_status = true;
u16 frag_threshold;
u16 frag_length, frag_offset = 0;
int i;
@@ -99,7 +98,7 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
write_nic_byte(dev, TPPoll, TPPoll_CQ);
- return rt_status;
+ return true;
}
static bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 90ed03a..51c21da 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -3059,7 +3059,6 @@ bool NicIFEnableNIC(struct net_device *dev)
}
bool NicIFDisableNIC(struct net_device *dev)
{
- bool status = true;
struct r8192_priv *priv = rtllib_priv(dev);
u8 tmp_state = 0;
@@ -3074,7 +3073,7 @@ bool NicIFDisableNIC(struct net_device *dev)
priv->ops->stop_adapter(dev, false);
RT_TRACE(COMP_PS, "<=========%s()\n", __func__);
- return status;
+ return true;
}
static int __init rtl8192_pci_module_init(void)
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 6157536..1af4191 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -232,9 +232,7 @@ static u8 HTIOTActIsDisableMCS14(struct rtllib_device *ieee, u8 *PeerMacAddr)
static bool HTIOTActIsDisableMCS15(struct rtllib_device *ieee)
{
- bool retValue = false;
-
- return retValue;
+ return false;
}
static bool HTIOTActIsDisableMCSTwoSpatialStream(struct rtllib_device *ieee) |
---
drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 3 +--
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +--
drivers/staging/rtl8192e/rtl819x_HTProc.c | 4 +---
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
index 6cb0326..fa9c081 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
@@ -36,7 +36,6 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
u32 buffer_len)
{
struct r8192_priv *priv = rtllib_priv(dev);
- bool rt_status = true;
u16 frag_threshold;
u16 frag_length, frag_offset = 0;
int i;
@@ -99,7 +98,7 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
write_nic_byte(dev, TPPoll, TPPoll_CQ);
- return rt_status;
+ return true;
}
static bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 90ed03a..51c21da 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -3059,7 +3059,6 @@ bool NicIFEnableNIC(struct net_device *dev)
}
bool NicIFDisableNIC(struct net_device *dev)
{
- bool status = true;
struct r8192_priv *priv = rtllib_priv(dev);
u8 tmp_state = 0;
@@ -3074,7 +3073,7 @@ bool NicIFDisableNIC(struct net_device *dev)
priv->ops->stop_adapter(dev, false);
RT_TRACE(COMP_PS, "<=========%s()\n", __func__);
- return status;
+ return true;
}
static int __init rtl8192_pci_module_init(void)
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 6157536..1af4191 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -232,9 +232,7 @@ static u8 HTIOTActIsDisableMCS14(struct rtllib_device *ieee, u8 *PeerMacAddr)
static bool HTIOTActIsDisableMCS15(struct rtllib_device *ieee)
{
- bool retValue = false;
-
- return retValue;
+ return false;
}
static bool HTIOTActIsDisableMCSTwoSpatialStream(struct rtllib_device *ieee)