[PATCH] staging: vt6656: Declare a few variables as __read_mostly

2020-03-01 Thread Oscar Carter
These include module parameters. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/main_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index 5e48b3ddb94c..701300202b21 100644 --- a/drivers

Re: [PATCH] staging: vt6656: Declare a few variables as __read_mostly

2020-03-01 Thread Oscar Carter
On Sun, Mar 01, 2020 at 01:25:14PM +0100, Greg Kroah-Hartman wrote: > On Sun, Mar 01, 2020 at 12:26:20PM +0100, Oscar Carter wrote: > > These include module parameters. > > > > Signed-off-by: Oscar Carter > > --- > > drivers/staging/vt6656/main_usb.c | 4 ++--

[PATCH] staging: vt6656: Remove unnecessary local variables initialization

2020-03-01 Thread Oscar Carter
Don't initialize variables that are then set a few lines later. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/main_usb.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c

Re: [PATCH] staging: vt6656: Declare a few variables as __read_mostly

2020-03-07 Thread Oscar Carter
On Sun, Mar 01, 2020 at 04:09:13PM +0100, Greg Kroah-Hartman wrote: > On Sun, Mar 01, 2020 at 02:17:01PM +0100, Oscar Carter wrote: > > On Sun, Mar 01, 2020 at 01:25:14PM +0100, Greg Kroah-Hartman wrote: > > > On Sun, Mar 01, 2020 at 12:26:20PM +0100, Oscar Carter wrote: >

[PATCH] staging: vt6656: Use BIT_ULL() macro instead of bit shift operation

2020-03-07 Thread Oscar Carter
Replace the bit left shift operation with the BIT_ULL() macro and remove the unnecessary "and" operation against the bit_nr variable. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/main_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/stag

Re: [PATCH] staging: vt6656: Use BIT_ULL() macro instead of bit shift operation

2020-03-08 Thread Oscar Carter
On Sun, Mar 08, 2020 at 07:55:38AM +0100, Greg Kroah-Hartman wrote: > On Sat, Mar 07, 2020 at 11:49:29AM +0100, Oscar Carter wrote: > > Replace the bit left shift operation with the BIT_ULL() macro and remove > > the unnecessary "and" operation against the bit_nr variab

Re: [PATCH] staging: vt6656: Use BIT_ULL() macro instead of bit shift operation

2020-03-14 Thread Oscar Carter
On Tue, Mar 10, 2020 at 10:50:11AM +0100, Greg Kroah-Hartman wrote: > On Sun, Mar 08, 2020 at 07:22:07PM +, Malcolm Priestley wrote: > > >>> */ > > >>> #undef __NO_VERSION__ > > >>> > > >>> +#include > > >>> #include > > >>> #include > > >>> #include "device.h" > > >>> @@ -802,8 +803,7

[PATCH v2] staging: vt6656: Use BIT_ULL() macro instead of bit shift operation

2020-03-14 Thread Oscar Carter
is now unnecessary. Signed-off-by: Oscar Carter --- Changelog v1 -> v2 - Add more information to clarify the patch. - Add notes about the legacy provide by Malcolm Priestley. drivers/staging/vt6656/main_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/stagi

[PATCH] staging: vt6656: Use ARRAY_SIZE instead of hardcoded size

2020-03-14 Thread Oscar Carter
Use ARRAY_SIZE to replace the hardcoded size so we will never have a mismatch. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/main_usb.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c

Re: [PATCH] staging: vt6656: Use ARRAY_SIZE instead of hardcoded size

2020-03-18 Thread Oscar Carter
On Tue, Mar 17, 2020 at 01:45:06PM +0300, Dan Carpenter wrote: > On Sat, Mar 14, 2020 at 05:47:54PM +0100, Oscar Carter wrote: > > Use ARRAY_SIZE to replace the hardcoded size so we will never have a > > mismatch. > > > > Signed-off-by: Oscar Carter > > --- >

[PATCH v2] staging: vt6656: Use ARRAY_SIZE instead of hardcoded size

2020-03-18 Thread Oscar Carter
Use ARRAY_SIZE to replace the hardcoded size so we will never have a mismatch. Signed-off-by: Oscar Carter --- Changelog v1 -> v2 - Use ARRAY_SIZE(priv->cck_pwr_tbl) everywhere instead of introducing a new variable to hold its value. drivers/staging/vt6656/main_usb.c | 7 ---

[PATCH] staging: vt6656: Use BIT() macro instead of hex value

2020-03-20 Thread Oscar Carter
Use the BIT() macro instead of the hexadecimal value to define the different bits in registers. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/desc.h | 35 ++--- drivers/staging/vt6656/device.h | 9 +- drivers/staging/vt6656/mac.h| 263 3 files

[PATCH] staging: vt6656: Use BIT() macro in vnt_mac_reg_bits_* functions

2020-03-20 Thread Oscar Carter
The last parameter in the functions vnt_mac_reg_bits_on and vnt_mac_reg_bits_off defines the bits to set or unset. So, it's more clear to use the BIT() macro instead of an hexadecimal value. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 5 +++-- drivers/staging/v

[PATCH] staging: vt6656: Use DIV_ROUND_UP macro instead of specific code

2020-03-22 Thread Oscar Carter
Use DIV_ROUND_UP macro instead of specific code with the same purpose. Also, remove the unused variables. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 21 - 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/staging/vt6656

Re: [PATCH] staging: vt6656: Use DIV_ROUND_UP macro instead of specific code

2020-03-24 Thread Oscar Carter
On Mon, Mar 23, 2020 at 11:42:00AM +0100, Greg Kroah-Hartman wrote: > On Sun, Mar 22, 2020 at 12:23:42PM +0100, Oscar Carter wrote: > > Use DIV_ROUND_UP macro instead of specific code with the same purpose. > > Also, remove the unused variables. > > > >

Re: [PATCH] staging: vt6656: Use BIT() macro instead of hex value

2020-03-26 Thread Oscar Carter
On Mon, Mar 23, 2020 at 10:35:18AM +0300, Dan Carpenter wrote: > On Fri, Mar 20, 2020 at 06:10:56PM +0100, Oscar Carter wrote: > > -#define RSR_ADDRBROAD 0x80 > > -#define RSR_ADDRMULTI 0x40 > > +#define RSR_ADDRBROAD BIT(7) > > +#define RSR_ADDRMULT

Re: [PATCH] staging: vt6656: Use BIT() macro in vnt_mac_reg_bits_* functions

2020-03-26 Thread Oscar Carter
On Mon, Mar 23, 2020 at 10:32:14AM +0300, Dan Carpenter wrote: > On Fri, Mar 20, 2020 at 07:13:26PM +0100, Oscar Carter wrote: > > +#include > > #include "mac.h" > > #include "baseband.h" > > #include "rf.h" > > @

Re: [PATCH v2] staging: vt6656: Use ARRAY_SIZE instead of hardcoded size

2020-03-26 Thread Oscar Carter
ts in a > > buffer overflow then static checkers would complain. If they changed it > > and it resulted in uninitialized data being used then it would be zero > > so that's okay. > > I wasn't sure where I should stand on this, that's clearer now.

[PATCH v2] staging: vt6656: Use DIV_ROUND_UP macro instead of specific code

2020-03-26 Thread Oscar Carter
Use DIV_ROUND_UP macro instead of specific code with the same purpose. Also, remove the unused variables. Signed-off-by: Oscar Carter --- Changelog v1 -> v2 - Rebase the original patch [1] against the staging-next branch of the greg's staging.git tree. [1] https://lore.kernel.

[PATCH] staging: vt6656: Define EnCFG_BBType_MASK as OR between previous defines

2020-03-27 Thread Oscar Carter
Define the EnCFG_BBType_MASK bit as an OR operation between two previous defines instead of using the OR between two new BIT macros. Thus, the code is more clear. Fixes: a74081b44291 ("staging: vt6656: Use BIT() macro instead of hex value") Signed-off-by: Oscar Carter Reviewed-by: Dan

[PATCH] staging: vt6656: Use defines in vnt_mac_reg_bits_* functions

2020-03-28 Thread Oscar Carter
ro in vnt_mac_reg_bits_* functions") Suggested-by: Dan Carpenter Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 6 -- drivers/staging/vt6656/card.c | 3 +-- drivers/staging/vt6656/mac.h | 12 drivers/staging/vt6656/main_usb.c | 2 +- 4 files c

[PATCH] staging: vt6656: Use defines in preamble_type variables

2020-03-28 Thread Oscar Carter
more clear. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 8 drivers/staging/vt6656/main_usb.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c index a19a563d8bcc..9bbafa7ff

[PATCH v2] staging: vt6656: Use defines in preamble_type variables

2020-03-28 Thread Oscar Carter
more clear. Signed-off-by: Oscar Carter --- Changelog v1 -> v2 - Spell checking correction in the changelog. drivers/staging/vt6656/baseband.c | 8 drivers/staging/vt6656/main_usb.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/vt6656/

[PATCH] staging: vt6656: Refactor the vnt_update_pre_ed_threshold function

2020-03-28 Thread Oscar Carter
ease the footprint and makes the code more clear. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 335 +- 1 file changed, 100 insertions(+), 235 deletions(-) diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband

Re: [PATCH] staging: vt6656: Use BIT() macro in vnt_mac_reg_bits_* functions

2020-04-01 Thread Oscar Carter
On Tue, Mar 31, 2020 at 01:41:30PM +0300, Dan Carpenter wrote: > On Thu, Mar 26, 2020 at 06:10:43PM +0100, Oscar Carter wrote: > > I will make these changes and i will send and incremental patch with the > > "Fixes:" tag due to the this patch has already been added

Re: [PATCH] staging: vt6656: Define EnCFG_BBType_MASK as OR between previous defines

2020-04-01 Thread Oscar Carter
On Mon, Mar 30, 2020 at 02:27:14PM +0200, Greg Kroah-Hartman wrote: > On Fri, Mar 27, 2020 at 05:58:02PM +0100, Oscar Carter wrote: > > Define the EnCFG_BBType_MASK bit as an OR operation between two previous > > defines instead of using the OR between two new BIT macros. Thus,

Re: [PATCH] staging: vt6656: Use defines in vnt_mac_reg_bits_* functions

2020-04-01 Thread Oscar Carter
On Tue, Mar 31, 2020 at 01:29:06PM +0300, Dan Carpenter wrote: > On Sat, Mar 28, 2020 at 10:54:33AM +0100, Oscar Carter wrote: > > Define the necessary bits in the CHANNEL, PAPEDELAY and GPIOCTL0 > > registers to can use them in the calls to vnt_mac_reg_bits_on and > >

Re: [PATCH] staging: vt6656: Use defines in vnt_mac_reg_bits_* functions

2020-04-02 Thread Oscar Carter
On Thu, Apr 02, 2020 at 11:58:07AM +0100, Malcolm Priestley wrote: > > > On 02/04/2020 10:19, Quentin Deslandes wrote: > > On 04/01/20 18:55:38, Oscar Carter wrote: > > > On Tue, Mar 31, 2020 at 01:29:06PM +0300, Dan Carpenter wrote: > > > > On Sat, Mar 28, 20

[PATCH v2] staging: vt6656: Define EnCFG_BBType_MASK as OR between previous defines

2020-04-02 Thread Oscar Carter
Define the EnCFG_BBType_MASK bit as an OR operation between two previous defines instead of using the OR between two new BIT macros. Thus, the code is more clear. Signed-off-by: Oscar Carter Reviewed-by: Dan Carpenter Reviewed-by: Quentin Deslandes --- Changelog v1 -> v2 - Remove the &qu

[PATCH 2/3] staging: vt6656: Use define instead of magic number for tx_rate

2020-04-04 Thread Oscar Carter
Use the define RATE_11M present in the file "device.h" instead of the magic number 3. So the code is more clear. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/baseband.c

[PATCH 1/3] staging: vt6656: Use ARRAY_SIZE instead of define RATE_54M

2020-04-04 Thread Oscar Carter
Use ARRAY_SIZE to replace the define RATE_54M so we will never have a mismatch. In this way, avoid the possibility of a buffer overflow if this define is changed in the future to a greater value. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 2 +- 1 file changed, 1

[PATCH 0/3] staging: vt6656: Cleanup of the vnt_get_frame_time function

2020-04-04 Thread Oscar Carter
. The second patch makes use of the define RATE_11M instead of a magic number. The third patch remove unnecessary local variable initialization. Oscar Carter (3): staging: vt6656: Use ARRAY_SIZE instead of define RATE_54M staging: vt6656: Use define instead of magic number for tx_rate

[PATCH 3/3] staging: vt6656: Remove unnecessary local variable initialization

2020-04-04 Thread Oscar Carter
Don't initialize the rate variable as it is set a few lines later. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c index a785f91

Re: [PATCH 1/3] staging: vt6656: Use ARRAY_SIZE instead of define RATE_54M

2020-04-06 Thread Oscar Carter
On Mon, Apr 06, 2020 at 02:13:23PM +0300, Dan Carpenter wrote: > On Sat, Apr 04, 2020 at 04:13:58PM +0200, Oscar Carter wrote: > > Use ARRAY_SIZE to replace the define RATE_54M so we will never have a > > mismatch. In this way, avoid the possibility of a buffer overflow if >

Re: [PATCH 2/3] staging: vt6656: Use define instead of magic number for tx_rate

2020-04-06 Thread Oscar Carter
On Mon, Apr 06, 2020 at 04:22:12PM +0200, Greg Kroah-Hartman wrote: > On Sat, Apr 04, 2020 at 04:13:59PM +0200, Oscar Carter wrote: > > Use the define RATE_11M present in the file "device.h" instead of the > > magic number 3. So the code is more clear. > >

Re: [PATCH 2/3] staging: vt6656: Use define instead of magic number for tx_rate

2020-04-07 Thread Oscar Carter
On Mon, Apr 06, 2020 at 07:58:08PM +0200, Greg Kroah-Hartman wrote: > On Mon, Apr 06, 2020 at 06:38:36PM +0200, Oscar Carter wrote: > > On Mon, Apr 06, 2020 at 04:22:12PM +0200, Greg Kroah-Hartman wrote: > > > On Sat, Apr 04, 2020 at 04:13:59PM +0200, Oscar Carter wrote: >

[PATCH 1/2] staging: vt6656: Use define instead of magic number for tx_rate

2020-04-07 Thread Oscar Carter
Use the define RATE_11M present in the file "device.h" instead of the magic number 3. So the code is more clear. Reviewed-by: Dan Carpenter Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drive

[PATCH 2/2] staging: vt6656: Remove unnecessary local variable initialization

2020-04-07 Thread Oscar Carter
Don't initialize the rate variable as it is set a few lines later. Reviewed-by: Dan Carpenter Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/v

[PATCH v2 0/2] staging: vt6656: Cleanup of the vnt_get_frame_time function

2020-04-07 Thread Oscar Carter
ate 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.2

[PATCH v3 0/2] staging: vt6656: Cleanup of the vnt_get_frame_time function

2020-04-07 Thread Oscar Carter
ate variable. Changelog v2 -> v3 - Use the version number in the subject line of patch 1/2 and 2/2. 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 ++

[PATCH v3 1/2] staging: vt6656: Use define instead of magic number for tx_rate

2020-04-07 Thread Oscar Carter
Use the define RATE_11M present in the file "device.h" instead of the magic number 3. So the code is more clear. Reviewed-by: Dan Carpenter Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drive

[PATCH v3 2/2] staging: vt6656: Remove unnecessary local variable initialization

2020-04-07 Thread Oscar Carter
Don't initialize the rate variable as it is set a few lines later. Reviewed-by: Dan Carpenter Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/v

Re: [PATCH v2 0/2] staging: vt6656: Cleanup of the vnt_get_frame_time function

2020-04-07 Thread Oscar Carter
On Tue, Apr 07, 2020 at 06:29:57PM +0200, Oscar Carter wrote: > 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. &

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

2020-04-10 Thread Oscar Carter
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 --- drivers/staging/vt6656/baseband.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/vt6656/bas

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

2020-04-10 Thread Oscar Carter
t 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->servic

[PATCH 1/2] staging: vt6656: Refactor the assignment of the phy->signal variable

2020-04-10 Thread Oscar Carter
Create a constant array with the values of the "phy->signal" for every rate. Remove all "phy->signal" assignments inside the switch statement and replace these with a single reading from the new vnt_phy_signal array. Signed-off-by: Oscar Carter --- drivers/stagi

Re: [PATCH 1/2] staging: vt6656: Refactor the assignment of the phy->signal variable

2020-04-10 Thread Oscar Carter
On Fri, Apr 10, 2020 at 04:37:59PM +0100, Malcolm Priestley wrote: > > > On 10/04/2020 12:28, Oscar Carter wrote: > > Create a constant array with the values of the "phy->signal" for every > > rate. Remove all "phy->signal" assignments inside th

Re: [PATCH 1/2] staging: vt6656: Refactor the assignment of the phy->signal variable

2020-04-10 Thread Oscar Carter
On Fri, Apr 10, 2020 at 05:40:52PM +0100, Malcolm Priestley wrote: > > > On 10/04/2020 16:59, Oscar Carter wrote: > > On Fri, Apr 10, 2020 at 04:37:59PM +0100, Malcolm Priestley wrote: > > > > > > > > > On 10/04/2020 12:28, Oscar Carter wrote: > > &g

[PATCH v2 1/2] staging: vt6656: Refactor the assignment of the phy->signal variable

2020-04-11 Thread Oscar Carter
the OR mask with BIT(3) or BIT(4) allow obtain a second value according to the rate, the preamble_type and the pkt_type. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 105 -- 1 file changed, 26 insertions(+), 79 deletions(-) diff --git a/drivers/st

[PATCH v2 0/2] staging: vt6656: Refactor the vnt_get_phy_field function

2020-04-11 Thread Oscar Carter
dimension as Malcolm Priestley has suggested. 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 | 108 -- 1 file

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

2020-04-11 Thread Oscar Carter
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 --- drivers/staging/vt6656/baseband.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/vt6656/bas

[PATCH 0/2] staging: vt6656: Refactor the vnt_vt3184_init function

2020-04-11 Thread Oscar Carter
This patch series makes a refactor of the vnt_vt3184_init function through two patches. The first one removes duplicate code in the if statements because different branches are almost the same. The second patch remove unnecessary local variable initialization. Oscar Carter (2): staging

[PATCH 2/2] staging: vt6656: Remove unnecessary local variable initialization

2020-04-11 Thread Oscar Carter
Don't initialize the ret variable as it is set a few lines later. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c index 276210a

[PATCH 1/2] staging: vt6656: Remove duplicate code in vnt_vt3184_init function

2020-04-11 Thread Oscar Carter
Remove duplicate code in "if" statements because different branches are almost the same. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 52 +++ 1 file changed, 12 insertions(+), 40 deletions(-) diff --git a/drivers/staging/vt6656/bas

[PATCH] staging: vt6656: Use BIT() macro instead of bit shift operator

2020-04-12 Thread Oscar Carter
Use the BIT() macro instead of the bit left shift operator. So the code is more clear. It's safe to remove the casting to u16 type because the value obtained never exceeds 16 bits. So the casting is unnecessary. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/card.c | 8 1

[PATCH] staging: vt6656: Return error code in vnt_rf_write_embedded function

2020-04-13 Thread Oscar Carter
ls to this function (vnt_rf_set_txpower) not use the returned values, so they not need to be fixed. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/rf.c | 99 - 1 file changed, 64 insertions(+), 35 deletions(-) diff --git a/drivers/staging/vt6656/rf.c

[RFC] staging: vt6656: Add formula to the vnt_rf_addpower function

2020-04-13 Thread Oscar Carter
Use a formula to calculate the return value of the vnt_rf_addpower function instead of the "if" statement with literal values for every case. Signed-off-by: Oscar Carter --- What is the better approach for this function ? Leave it as is or use a formula although it is less clear. I

Re: [PATCH v3 1/2] staging: vt6656: Use define instead of magic number for tx_rate

2020-04-13 Thread Oscar Carter
On Mon, Apr 13, 2020 at 02:56:33PM +0200, Greg Kroah-Hartman wrote: > On Tue, Apr 07, 2020 at 06:39:14PM +0200, Oscar Carter wrote: > > Use the define RATE_11M present in the file "device.h" instead of the > > magic number 3. So the code is more clear. > >

Re: [PATCH v2 1/2] staging: vt6656: Refactor the assignment of the phy->signal variable

2020-04-13 Thread Oscar Carter
On Mon, Apr 13, 2020 at 02:56:16PM +0200, Greg Kroah-Hartman wrote: > On Sat, Apr 11, 2020 at 02:26:09PM +0200, Oscar Carter wrote: > > Create a constant array with the values of the "phy->signal" for every > > rate. Remove all "phy->signal" assignments in

Re: [PATCH v3 1/2] staging: vt6656: Use define instead of magic number for tx_rate

2020-04-13 Thread Oscar Carter
On Mon, Apr 13, 2020 at 04:29:07PM +0200, Greg Kroah-Hartman wrote: > On Mon, Apr 13, 2020 at 04:13:15PM +0200, Oscar Carter wrote: > > On Mon, Apr 13, 2020 at 02:56:33PM +0200, Greg Kroah-Hartman wrote: > > > On Tue, Apr 07, 2020 at 06:39:14PM +0200, Oscar Carter wrote: >

Re: [PATCH v2 1/2] staging: vt6656: Refactor the assignment of the phy->signal variable

2020-04-13 Thread Oscar Carter
On Mon, Apr 13, 2020 at 04:32:58PM +0200, Greg Kroah-Hartman wrote: > On Mon, Apr 13, 2020 at 04:25:17PM +0200, Oscar Carter wrote: > > On Mon, Apr 13, 2020 at 02:56:16PM +0200, Greg Kroah-Hartman wrote: > > > On Sat, Apr 11, 2020 at 02:26:09PM +0200, Oscar Carter wrote: > &g

[PATCH 5/5] staging: vt6656: Remove duplicate code for the phy->service assignment

2020-04-14 Thread Oscar Carter
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 --- drivers/staging/vt6656/baseband.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/vt6656/bas

[PATCH 1/5] staging: vt6656: Return error code in vnt_rf_write_embedded function

2020-04-14 Thread Oscar Carter
ls to this function (vnt_rf_set_txpower) not use the returned values, so they not need to be fixed. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/rf.c | 99 - 1 file changed, 64 insertions(+), 35 deletions(-) diff --git a/drivers/staging/vt6656/rf.c

[PATCH 2/5] staging: vt6656: Use BIT() macro instead of bit shift operator

2020-04-14 Thread Oscar Carter
Use the BIT() macro instead of the bit left shift operator. So the code is more clear. It's safe to remove the casting to u16 type because the value obtained never exceeds 16 bits. So the casting is unnecessary. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/card.c | 4 ++-- 1

[PATCH 3/5] staging: vt6656: Use define instead of magic number for tx_rate

2020-04-14 Thread Oscar Carter
Use the define RATE_11M present in the file "device.h" instead of the magic number 3. So the code is more clear. Reviewed-by: Dan Carpenter Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drive

[PATCH 4/5] staging: vt6656: Refactor the assignment of the phy->signal variable

2020-04-14 Thread Oscar Carter
the OR mask with BIT(3) or BIT(4) allow obtain a second value according to the rate, the preamble_type and the pkt_type. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 105 -- 1 file changed, 26 insertions(+), 79 deletions(-) diff --git a/drivers/st

[PATCH 0/5] staging: vt6656: Rebase all rejected patches

2020-04-14 Thread Oscar Carter
urth patch creates a constant array with the values of the "phy->signal" variable for every rate and makes a refactor of the assignment of this variable. The fifth path takes out the "phy->service" assignment from the if-else statement due to it's the same for the two bra

Re: [RFC] staging: vt6656: Add formula to the vnt_rf_addpower function

2020-04-15 Thread Oscar Carter
On Tue, Apr 14, 2020 at 04:12:14PM +0300, Dan Carpenter wrote: > On Mon, Apr 13, 2020 at 04:02:09PM +0200, Oscar Carter wrote: > > diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c > > index 4f9aba0f21b0..3b200d7290a5 100644 > > --- a/drivers/staging/

[PATCH 0/2] staging: vt6656: Check the return value of vnt_control_out_* calls

2020-04-18 Thread Oscar Carter
has changed by the kernel-doc style, fixing the parameters and return value. Oscar Carter (2): staging: vt6656: Check the return value of vnt_control_out_* calls staging: vt6656: Fix functions' documentation drivers/staging/vt6656/baseband.c | 35 +++--- drivers/staging/vt6656/baseb

[PATCH 2/2] staging: vt6656: Fix functions' documentation

2020-04-18 Thread Oscar Carter
Replace the functions' documentation by the kernel-doc style fixing the parameters and return value. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/card.c | 101 +++-- drivers/staging/vt6656/mac.c | 67 -- drivers/staging/v

[PATCH 1/2] staging: vt6656: Check the return value of vnt_control_out_* calls

2020-04-18 Thread Oscar Carter
efore the call didn't check the return value, now neither. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 35 ++- drivers/staging/vt6656/baseband.h | 4 +- drivers/staging/vt6656/card.c | 97 --- drivers/staging/vt6656/card.

[PATCH] staging: vt6656: Refactor the vnt_ofdm_min_rate function

2020-04-18 Thread Oscar Carter
achieved using only one single mask which comprises all the commented bits. This way avoid the iteration over an unnecessary for loop. Also change the return type to bool because it's the type that this function returns. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/card.c | 11 ++-

Re: [PATCH 2/2] staging: vt6656: Fix functions' documentation

2020-04-19 Thread Oscar Carter
eds to be removed the bss callers to baseband.c, the tbtt's to > power.c > and the rest to mac.c > > Regards > > Malcolm Thanks, Oscar Carter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[PATCH] staging: vt6656: Use fls instead of for loop in vnt_update_top_rates

2020-04-19 Thread Oscar Carter
iteration over unnecessary for loops. The header "linux/bits.h" can be remove as it is included in the header "linux/bitops.h". Signed-off-by: Oscar Carter --- drivers/staging/vt6656/card.c | 28 ++-- 1 file changed, 6 insertions(+), 22 deletions(-)

Re: [PATCH 2/2] staging: vt6656: Fix functions' documentation

2020-04-19 Thread Oscar Carter
On Sun, Apr 19, 2020 at 10:22:50AM +0100, Malcolm Priestley wrote: > > > On 19/04/2020 08:47, Oscar Carter wrote: > > On Sat, Apr 18, 2020 at 07:05:53PM +0100, Malcolm Priestley wrote: > >> Actually I don't really think the function descriptions are needed at al

[PATCH v2 2/2] staging: vt6656: Remove functions' documentation

2020-04-19 Thread Oscar Carter
Remove the functions' documentation as the names of the functions are clear enought. Also, the actual documentation it's not correct in all cases. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/card.c | 79 -- drivers/staging/vt6656/ma

[PATCH v2 0/2] staging: vt6656: Check the return value of vnt_control_out_* calls

2020-04-19 Thread Oscar Carter
has changed as the function names are clear enought. Also, the actual documentation is not correct in all cases. Changelog v1 -> v2 - Remove the function's documentation instead of fix them as suggested Malcolm Priestley. Oscar Carter (2): staging: vt6656: Check the return

[PATCH v2 1/2] staging: vt6656: Check the return value of vnt_control_out_* calls

2020-04-19 Thread Oscar Carter
efore the call didn't check the return value, now neither. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 35 ++- drivers/staging/vt6656/baseband.h | 4 +- drivers/staging/vt6656/card.c | 97 --- drivers/staging/vt6656/card.

Re: [PATCH] staging: vt6656: Use fls instead of for loop in vnt_update_top_rates

2020-04-20 Thread Oscar Carter
On Mon, Apr 20, 2020 at 03:10:59PM +0300, Dan Carpenter wrote: > On Sun, Apr 19, 2020 at 12:09:21PM +0200, Oscar Carter wrote: > > - for (i = RATE_11M;; i--) { > > - if (priv->basic_rates & (u16)(1 << i)) { > > - top_cck

[PATCH v2] staging: vt6656: Use fls instead of for loop in vnt_update_top_rates

2020-04-20 Thread Oscar Carter
iteration over unnecessary for loops. The header "linux/bits.h" can be remove as it is included in the header "linux/bitops.h". Signed-off-by: Oscar Carter --- Changelog v1 -> v2 - Replace the expression pos-- with the expresion (pos - 1) as Dan Carpenter suggested.

Re: [RFC] staging: vt6656: Add formula to the vnt_rf_addpower function

2020-04-20 Thread Oscar Carter
On Wed, Apr 15, 2020 at 06:25:41PM +0200, Oscar Carter wrote: > On Tue, Apr 14, 2020 at 04:12:14PM +0300, Dan Carpenter wrote: > > On Mon, Apr 13, 2020 at 04:02:09PM +0200, Oscar Carter wrote: > > > diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c > &

Re: [PATCH v2 1/2] staging: vt6656: Check the return value of vnt_control_out_* calls

2020-04-23 Thread Oscar Carter
On Thu, Apr 23, 2020 at 01:40:32PM +0200, Greg Kroah-Hartman wrote: > On Sun, Apr 19, 2020 at 12:48:20PM +0200, Oscar Carter wrote: > > Check the return value of vnt_control_out_* function calls. When > > necessary modify the function prototype to be able to return the new > &g

[PATCH v3 0/2] staging: vt6656: Check the return value of vnt_control_out_* calls

2020-04-23 Thread Oscar Carter
h of Greg's staging tree. Oscar Carter (2): staging: vt6656: Check the return value of vnt_control_out_* calls staging: vt6656: Remove functions' documentation drivers/staging/vt6656/baseband.c | 35 +++--- drivers/staging/vt6656/baseband.h | 4 +- drivers/staging/vt

[PATCH v3 1/2] staging: vt6656: Check the return value of vnt_control_out_* calls

2020-04-23 Thread Oscar Carter
efore the call didn't check the return value, now neither. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 35 ++- drivers/staging/vt6656/baseband.h | 4 +- drivers/staging/vt6656/card.c | 97 --- drivers/staging/vt6656/card.

[PATCH v3 2/2] staging: vt6656: Remove functions' documentation

2020-04-23 Thread Oscar Carter
Remove the functions' documentation as the names of the functions are clear enought. Also, the actual documentation it's not correct in all cases. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/card.c | 79 -- drivers/staging/vt6656/ma

[PATCH v2] staging: vt6656: Add formula to the vnt_rf_addpower function

2020-04-23 Thread Oscar Carter
Use a formula to calculate the return value of the vnt_rf_addpower function instead of the "if" statement with literal values for every case. Signed-off-by: Oscar Carter --- Changelog v1 -> v2 - Change the type of "base" variable from s32 to int as Dan Carpenter

[PATCH 0/3] Refactor the vnt_rf_table_download function

2020-04-25 Thread Oscar Carter
the "goto" statements with a direct "return ret" as the jump label only returns the ret variable. The third patch replaces three while loops with three calls to the vnt_control_out_blocks function. This way avoid repeat a functionality that already exists. Oscar Carter (3): sta

[PATCH 2/3] staging: vt6656: Use return instead of goto

2020-04-25 Thread Oscar Carter
Replace the "goto" statements with a direct "return ret" as the jump label only returns the ret variable. Also, remove the unnecessary variable initialization because the ret variable is set a few lines later. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/rf.c | 1

[PATCH 3/3] staging: vt6656: Remove duplicate code in vnt_rf_table_download

2020-04-25 Thread Oscar Carter
Replace three while loops with three calls to the vnt_control_out_blocks function. This way avoid repeat a functionality that already exists. Also remove the variables that now are not used. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/rf.c | 65

[PATCH 1/3] staging: vt6656: Remove the local variable "array"

2020-04-25 Thread Oscar Carter
Remove the local variable "array" and all the memcpy function calls because this copy operation from different arrays to this variable is unnecessary. The same result can be achieved using the arrays directly. Signed-off-by: Oscar Carter --- drivers/staging/vt6656

Re: [PATCH v3 0/2] staging: vt6656: Check the return value of vnt_control_out_* calls

2020-04-25 Thread Oscar Carter
On Sat, Apr 25, 2020 at 12:56:26PM +0200, Greg Kroah-Hartman wrote: > On Thu, Apr 23, 2020 at 05:38:34PM +0200, Oscar Carter wrote: > > This patch series checks the return value of vnt_control_out_* function > > calls. > > > > The first patch checks the return value an

[PATCH v4 0/2] staging: vt6656: Check the return value of vnt_control_out_* calls

2020-04-25 Thread Oscar Carter
h of Greg's staging tree. Changelog v3 -> v4 - Rebase again. Oscar Carter (2): staging: vt6656: Check the return value of vnt_control_out_* calls staging: vt6656: Remove functions' documentation drivers/staging/vt6656/baseband.c | 35 +++--- drivers/staging/vt6656/baseband.h | 4 +-

[PATCH v4 2/2] staging: vt6656: Remove functions' documentation

2020-04-25 Thread Oscar Carter
Remove the functions' documentation as the names of the functions are clear enought. Also, the actual documentation it's not correct in all cases. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/card.c | 79 -- drivers/staging/vt6656/ma

[PATCH v4 1/2] staging: vt6656: Check the return value of vnt_control_out_* calls

2020-04-25 Thread Oscar Carter
efore the call didn't check the return value, now neither. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/baseband.c | 35 ++- drivers/staging/vt6656/baseband.h | 4 +- drivers/staging/vt6656/card.c | 97 --- drivers/staging/vt6656/card.

Re: [PATCH v2] staging: vt6656: Add formula to the vnt_rf_addpower function

2020-04-25 Thread Oscar Carter
On Sat, Apr 25, 2020 at 12:57:14PM +0200, Greg Kroah-Hartman wrote: > On Thu, Apr 23, 2020 at 07:05:57PM +0200, Oscar Carter wrote: > > Use a formula to calculate the return value of the vnt_rf_addpower > > function instead of the "if" statement with literal

[PATCH v3] staging: vt6656: Add formula to the vnt_rf_addpower function

2020-04-25 Thread Oscar Carter
Use a formula to calculate the return value of the vnt_rf_addpower function instead of the "if" statement with literal values for every case. Signed-off-by: Oscar Carter --- Changelog v1 -> v2 - Change the type of "base" variable from s32 to int as Dan Carpenter

Re: [PATCH 1/3] staging: vt6656: Remove the local variable "array"

2020-04-25 Thread Oscar Carter
On Sat, Apr 25, 2020 at 05:50:39AM -0700, Joe Perches wrote: > On Sat, 2020-04-25 at 14:38 +0200, Oscar Carter wrote: > > Remove the local variable "array" and all the memcpy function calls > > because this copy operation from different arrays to this variable is >

[PATCH v2 2/3] staging: vt6656: Use return instead of goto

2020-04-25 Thread Oscar Carter
Replace the "goto" statements with a direct "return ret" as the jump label only returns the ret variable. Also, remove the unnecessary variable initialization because the ret variable is set a few lines later. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/rf.c | 1

[PATCH v2 1/3] staging: vt6656: Remove the local variable "array"

2020-04-25 Thread Oscar Carter
to fail. Since there is a wide range of buffer sizes use kmemdup to create allocated buffer. So, the same result can be achieved using the arrays directly. Signed-off-by: Oscar Carter --- drivers/staging/vt6656/rf.c | 21 + 1 file changed, 5 insertions(+), 16 deleti

[PATCH v2 0/3] Refactor the vnt_rf_table_download function

2020-04-25 Thread Oscar Carter
odify the commit changelog of the first patch to clarify the change as Joe Perches suggested. Oscar Carter (3): staging: vt6656: Remove the local variable "array" staging: vt6656: Use return instead of goto staging: vt6656: Remove duplicate code in vnt_rf_table_

  1   2   >