2020-04-10 11:30:47

by Oscar Carter

[permalink] [raw]
Subject: [PATCH 0/2] staging: vt6656: Refactor the vnt_get_phy_field function

This patch series makes a refactor of the vnt_get_phy_field function
through two patches.

The first one refactors the assignment of the "phy->signal" variable
using a constant array with the correct values for every rate.

The second patch removes duplicate code for the assignment of the
"phy->service" variable by putting it outside the if-else statement due
to it's the same for the two branches.

Oscar Carter (2):
staging: vt6656: Refactor the assignment of the phy->signal variable
staging: vt6656: Remove duplicate code for the phy->service assignment

drivers/staging/vt6656/baseband.c | 104 +++++++-----------------------
1 file changed, 22 insertions(+), 82 deletions(-)

--
2.20.1


2020-04-10 11:31:00

by Oscar Carter

[permalink] [raw]
Subject: [PATCH 2/2] staging: vt6656: Remove duplicate code for the phy->service assignment

Take out the "phy->service" assignment from the if-else statement due to
it's the same for the two branches.

Signed-off-by: Oscar Carter <[email protected]>
---
drivers/staging/vt6656/baseband.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index 47f93bf6e07b..b0054f6c07e6 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -233,14 +233,13 @@ void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
: preamble_type == PREAMBLE_SHORT;

phy->signal = vnt_phy_signal[i][j];
+ phy->service = 0x00;

if (pkt_type == PK_TYPE_11B) {
- phy->service = 0x00;
if (ext_bit)
phy->service |= 0x80;
phy->len = cpu_to_le16((u16)count);
} else {
- phy->service = 0x00;
phy->len = cpu_to_le16((u16)frame_length);
}
}
--
2.20.1