staging: vt6656: Cleanup of the vnt_get_frame_time function
v2 cover staging: vt6656: Cleanup of the vnt_get_frame_time function
This patch series makes a cleanup of the vnt_get_frame_time function.
The first patch makes use of the define RATE_11M instead of a magic number. The second patch remove unnecessary local variable initialization.
Changelog v1 -> v2
- Not use the ARRAY_SIZE macro to compare against the tx_rate variable.
Oscar Carter (2):
staging: vt6656: Use define instead of magic number for tx_rate
staging: vt6656: Remove unnecessary local variable initialization
drivers/staging/vt6656/baseband.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
--
2.20.1
PATCH v2 1/2 staging: vt6656: Use define instead of magic number for tx_rate
Use the define RATE_11M present in the file "device.h" instead of the magic number 3. So the code is more clear.
--- drivers/staging/vt6656/baseband.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/vt6656/baseband.c +2 -1
@@ -24,6 +24,7 @@#include <linux/bits.h> #include <linux/kernel.h> +#include "device.h" #include "mac.h" #include "baseband.h" #include "rf.h"
@@ -141,7 +142,7 @@ unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type, rate = (unsigned int )vnt_frame_time[tx_rate]; -if (tx_rate <=3 ) { +if (tx_rate <=RATE_11M ) {if (preamble_type ==1 ) preamble =96 ;else
--
2.20.1
PATCH v2 2/2 staging: vt6656: Remove unnecessary local variable initialization
In reply to Oscar CarterDon't initialize the rate variable as it is set a few lines later.
--- drivers/staging/vt6656/baseband.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6656/baseband.c +1 -1
@@ -135,7 +135,7 @@ unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type, {unsigned int frame_time;unsigned int preamble; -unsigned int rate =0 ; +unsigned int rate;if (tx_rate >RATE_54M )return 0 ;
--
2.20.1
Quoted 12 lines · Oscar Carter
This patch series makes a cleanup of the
vnt_get_frame_timefunction.The first patch makes use of the define
RATE_11Minstead of a magic number. The second patch remove unnecessary local variable initialization.Changelog v1 -> v2
- Not use theARRAY_SIZEmacro to compare against thetx_ratevariable.Oscar Carter (2):
staging: vt6656: Use define instead of magic number fortx_rate
staging: vt6656: Remove unnecessary local variable initialization
Quoted 6 lines
drivers/staging/vt6656/baseband.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)--
2.20.1
Don't review this patch series as I have sent a new version. Sorry.
Thanks
Oscar Carter