summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8712/rtl871x_mp.c
diff options
context:
space:
mode:
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>2015-10-26 23:25:59 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-27 16:58:00 +0900
commitb85f3d4e58379e523b06d9725f26f0a0566a1727 (patch)
tree7beda03a68a9de26c977c0a52d8e644e1747a57a /drivers/staging/rtl8712/rtl871x_mp.c
parentf0d97eb5c0c889fc68eb97885d488c3842e296da (diff)
staging: rtl8712: Remove unnecessary variables
Remove unnecessary variables that can be replaced with a single line of code. The semantic patch used to find this is: // <smpl> @@ expression ret; @@ - if (ret) return ret; - return 0; + return ret; @@ local idexpression ret; expression e; @@ - ret = e; - return ret; + return e; @@ type T; identifier i; expression E; @@ - T i = E; ... when != i @@ type T; identifier i; @@ - T i; ... when != i // </smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712/rtl871x_mp.c')
-rw-r--r--drivers/staging/rtl8712/rtl871x_mp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_mp.c b/drivers/staging/rtl8712/rtl871x_mp.c
index e1cb149253b8..231cdc2ceea8 100644
--- a/drivers/staging/rtl8712/rtl871x_mp.c
+++ b/drivers/staging/rtl8712/rtl871x_mp.c
@@ -218,12 +218,11 @@ static u32 bitshift(u32 bitmask)
static u32 get_bb_reg(struct _adapter *pAdapter, u16 offset, u32 bitmask)
{
- u32 org_value, bit_shift, new_value;
+ u32 org_value, bit_shift;
org_value = r8712_bb_reg_read(pAdapter, offset);
bit_shift = bitshift(bitmask);
- new_value = (org_value & bitmask) >> bit_shift;
- return new_value;
+ return (org_value & bitmask) >> bit_shift;
}
static u8 set_bb_reg(struct _adapter *pAdapter,
@@ -246,12 +245,11 @@ static u8 set_bb_reg(struct _adapter *pAdapter,
static u32 get_rf_reg(struct _adapter *pAdapter, u8 path, u8 offset,
u32 bitmask)
{
- u32 org_value, bit_shift, new_value;
+ u32 org_value, bit_shift;
org_value = r8712_rf_reg_read(pAdapter, path, offset);
bit_shift = bitshift(bitmask);
- new_value = (org_value & bitmask) >> bit_shift;
- return new_value;
+ return (org_value & bitmask) >> bit_shift;
}
static u8 set_rf_reg(struct _adapter *pAdapter, u8 path, u8 offset, u32 bitmask,