提交 b85f3d4e 编写于 作者: A Amitoj Kaur Chawla 提交者: Greg Kroah-Hartman

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: NAmitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 f0d97eb5
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册