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

2020-04-02 Thread Quentin Deslandes
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, 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

Re: [PATCH v8] staging: vt6656: add error code handling to unused variable

2020-03-31 Thread Quentin Deslandes
gt; > > Issue reported by coccinelle (coccicheck). > > > > Suggested-by: Quentin Deslandes > > Suggested-by: Stefano Brivio > > Reviewed-by: Quentin Deslandes > ^ This should be dropped unless Quentin agrees to this version as well > > > Signed

Re: [PATCH v3] staging: vt6656: add error code handling to unused variable

2020-03-30 Thread Quentin Deslandes
On 03/29/20 01:43:20, John B. Wyatt IV wrote: > Add error code handling to unused 'ret' variable that was never used. > Return an error code from functions called within vnt_radio_power_on. > > Issue reported by coccinelle (coccicheck). > > Suggested-by: Quentin Desl

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

2020-03-30 Thread Quentin Deslandes
On 03/30/20 16:49:04, Quentin Deslandes wrote: > On 03/28/20 15:09:55, Oscar Carter wrote: > > Use the PREAMBLE_SHORT and PREAMBLE_LONG defines present in the file > > "baseband.h" to assign values to preamble_type variables. Also, use the > > same defi

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

2020-03-30 Thread Quentin Deslandes
ble_barker_preamble_mode(priv); > - priv->preamble_type = true; > + priv->preamble_type = PREAMBLE_SHORT; > } else { > vnt_mac_disable_barker_preamble_mode(priv); > - priv->preamble_type = fal

Re: [PATCH] staging: vt6656: Refactor the vnt_update_pre_ed_threshold function

2020-03-30 Thread Quentin Deslandes
62) { > - ed_inx = 5; > - cr_206 = 0x9c; > - } else if (priv->bb_pre_ed_rssi <= 63) { > - ed_inx = 4; > - cr_206 = 0x80; > - } else if (priv->bb_pre_ed_rssi <= 64) { > -

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

2020-03-30 Thread Quentin Deslandes
ne EnCFG_BBType_MASK(BIT(0) | BIT(1)) > +#define EnCFG_BBType_MASK(EnCFG_BBType_b | EnCFG_BBType_g) > #define EnCFG_ProtectMd BIT(5) > > /* Bits in the EnhanceCFG_1 register */ > -- > 2.20.1 > Reviewed-by: Quentin Deslandes Thanks, Quentin _

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

2020-03-30 Thread Quentin Deslandes
f->use_short_preamble) { > vnt_mac_enable_barker_preamble_mode(priv); > - priv->preamble_type = true; > + priv->preamble_type = PREAMBLE_SHORT; > } else { > vnt_m

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

2020-03-27 Thread Quentin Deslandes
YPE_11A) > @@ -214,11 +205,7 @@ void vnt_get_phy_field(struct vnt_private *priv, u32 > frame_length, > > break; > case RATE_5M: > - count = (bit_count * 10) / 55; > - tmp = (count * 55) / 10; > - > - if (tmp != bit_count

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

2020-03-25 Thread Quentin Deslandes
On 03/24/20 16:18:30, Dan Carpenter wrote: > That's a bit over engineering something which is pretty trivial. > Normally, we would just make the size a define instead of a magic number > 14. My bad, I meant "define", not "macro". > If people change the size in the future (unlikely) and it causes

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

2020-03-24 Thread Quentin Deslandes
On 03/18/20 18:40:15, Oscar Carter wrote: > 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. >

Re: [PATCH 1/2] staging: vt6656: remove unneeded variable: ret

2020-03-24 Thread Quentin Deslandes
On 03/23/20 23:45:44, John B. Wyatt IV wrote: > vnt_mac_reg_bits_off(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD); This function, and all the functions called in vnt_radio_power_on() returns a value, why don't you catch it and act accordingly (forward error code for example) instead of silencing

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

2020-03-09 Thread Quentin Deslandes
On Sat, Mar 07, 2020 at 09:29:06AM +0100, Oscar Carter wrote: > 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: > > This is a USB driver, performance is always limited to the hardware, not > > the CPU location of

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

2020-03-02 Thread Quentin Deslandes
ach(ha, mc_list) { > bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26; > @@ -973,7 +973,7 @@ vt6656_probe(struct usb_interface *intf, const struct > usb_device_id *id) > struct vnt_private *priv; > struct ieee80211_hw *hw; > struct wiphy *

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

2020-03-02 Thread Quentin Deslandes
t; #define TX_DESC_DEF0 64 > -static int vnt_tx_buffers = TX_DESC_DEF0; > +static int __read_mostly vnt_tx_buffers = TX_DESC_DEF0; > module_param_named(tx_buffers, vnt_tx_buffers, int, 0644); > MODULE_PARM_DESC(tx_buffers, "Number of receive usb tx buffers"); > > -- >

[PATCH] staging: axis-fifo: replace spinlock with mutex

2020-01-21 Thread Quentin Deslandes
was using copy_from_user() and copy_to_user(), we need to replace spinlocks with mutexes. Signed-off-by: Quentin Deslandes --- drivers/staging/axis-fifo/axis-fifo.c | 160 -- 1 file changed, 101 insertions(+), 59 deletions(-) diff --git a/drivers/staging/axis-fifo/axis-fifo.c

Re: [PATCH 1/5] staging: vt6656: Fix non zero logical return of, usb_control_msg

2020-01-06 Thread Quentin Deslandes
b_control_msg(). > > if (ret == length) > ret = 0; > else if (ret >= 0) > ret = -EIO; > > regards, > dan carpenter > Thanks for CC. Nice catch. Dan is right, we should forward any error code from usb_control_msg(). Regards, Quentin Deslandes ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[PATCH 1/3] staging: axis-fifo: avoid parsing ignored device tree properties

2019-11-01 Thread Quentin Deslandes
the ignored / unsupported properties. Signed-off-by: Quentin Deslandes --- drivers/staging/axis-fifo/axis-fifo.c | 247 ++-- drivers/staging/axis-fifo/axis-fifo.txt | 18 +- 2 files changed, 74 insertions(+), 191 deletions(-) diff --git a/drivers/staging/axis-fifo/axis

[PATCH 2/3] staging: axis-fifo: request resources using managed functions

2019-11-01 Thread Quentin Deslandes
Request device's resources (memory, interrupt...) using managed function. Signed-off-by: Quentin Deslandes --- drivers/staging/axis-fifo/axis-fifo.c | 45 --- 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers

[PATCH 3/3] staging: axis-fifo: remove unused pointer to memory resource

2019-11-01 Thread Quentin Deslandes
Remove unused resource pointer from the device's internal structure. Signed-off-by: Quentin Deslandes --- drivers/staging/axis-fifo/axis-fifo.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis

[PATCH 0/3] staging: axis-fifo: probe function cleanup

2019-11-01 Thread Quentin Deslandes
Avoid parsing unused device tree properties and add a note on ignored / unsupported properties inside the joined documentation instead. Also use managed functions to claim the device's resources and remove unused resource pointer from the device's internal structure. Quentin Deslandes (3

Re: [PATCH] staging: vt6656: remove duplicated blank line

2019-10-07 Thread Quentin Deslandes
t_private *priv) > goto end; > } > > - > ret = vnt_mac_set_led(priv, LEDSTS_TMLEN, 0x38); > if (ret) > goto end; > -- > 2.20.1 > Reviewed-by: Quentin Deslandes Thank you, Quentin _

Re: [PATCH] staging: vt6656: clean up an indentation issue

2019-09-27 Thread Quentin Deslandes
t; - else > - priv->rx_antenna_mode = ANT_B; > + if (priv->tx_rx_ant_inv) > + priv->rx_antenna_mode = ANT_A; > + else > + priv->rx_antenna_mode = ANT_

Re: [PATCH] staging: vt6656: Use common error handling code in vnt_alloc_bufs()

2019-08-23 Thread Quentin Deslandes
On Fri, Aug 23, 2019 at 03:30:11PM +0200, Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 23 Aug 2019 15:15:41 +0200 > > Adjust jump targets so that a bit of exception handling can be better > reused at the end of this function. > > This issue was detected by using the Coccinelle

Re: [PATCH] staging: vt6656: Delete an unnecessary check before the macro call “dev_kfree_skb”

2019-08-21 Thread Quentin Deslandes
if (rcb->skb) > - dev_kfree_skb(rcb->skb); > + dev_kfree_skb(rcb->skb); > > kfree(rcb); > } > -- > 2.23.0 > Reviewed-by: Quentin Deslandes Regards, Quentin ___ devel mailin

Re: [PATCH] staging: vt6656: fix indentation on break statement

2019-06-20 Thread Quentin Deslandes
bb_type, > *tx_rate = 0x8b; > *rsv_time = 30; > } > - break; > + break; > case RATE_9M: > if (bb_type == BB_TYPE_11A) { > *tx_rate = 0x9f; &g

[PATCH 2/7] staging: vt6656: clean function's error path in usbpipe.c

2019-05-20 Thread Quentin Deslandes
Avoid discarding called function's returned value. Store it instead in order to act accordingly. Update error path to return 0 on success and a negative errno value on error. Signed-off-by: Quentin Deslandes --- drivers/staging/vt6656/usbpipe.c | 115 +-- drivers

[PATCH 6/7] staging: vt6656: clean-up registers initialization error path

2019-05-20 Thread Quentin Deslandes
Avoid discarding function's return code during register initialization. Handle it instead and return 0 on success or a negative errno value on error. Signed-off-by: Quentin Deslandes --- drivers/staging/vt6656/main_usb.c | 163 ++ 1 file changed, 96 insertions(+), 67

[PATCH 0/7] staging: vt6656: clean-up error path on init

2019-05-20 Thread Quentin Deslandes
a potential NULL pointer dereferencing. All the other patches update function's error management workflow and prototype when needed. More functions would need to be updated, but focusing on initialization process force to change only a reasonable amount of code. Thank you, Quentin Quentin Deslandes

[PATCH 5/7] staging: vt6656: use meaningful error code during buffer allocation

2019-05-20 Thread Quentin Deslandes
Check on called function's returned value for error and return 0 on success or a negative errno value on error instead of a boolean value. Signed-off-by: Quentin Deslandes --- drivers/staging/vt6656/main_usb.c | 42 --- 1 file changed, 28 insertions(+), 14 deletions

[PATCH 4/7] staging: vt6656: clean error path for firmware management

2019-05-20 Thread Quentin Deslandes
Avoid discarding return value of functions called during firmware management process. Handle such return value and return 0 on success or a negative errno value on error. Signed-off-by: Quentin Deslandes --- drivers/staging/vt6656/firmware.c | 91 ++- 1 file changed

[PATCH 3/7] staging: vt6656: avoid discarding called function's return code

2019-05-20 Thread Quentin Deslandes
Change some of the driver's functions in order to handle error codes instead of discarding them. These function now returns 0 on success and a negative errno value on error. Signed-off-by: Quentin Deslandes --- drivers/staging/vt6656/baseband.c | 130 -- drivers

[PATCH 7/7] staging: vt6656: manage error path during device initialization

2019-05-20 Thread Quentin Deslandes
Check for error during device initialization callback and return a meaningful error code or zero on success. Signed-off-by: Quentin Deslandes --- drivers/staging/vt6656/main_usb.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/staging/vt6656

[PATCH 1/7] staging: vt6656: fix potential NULL pointer dereference

2019-05-20 Thread Quentin Deslandes
vnt_free_tx_bufs() relies on priv->tx_context elements to be NULL if they are not initialized (as vnt_free_rx_bufs() does). Add a check to these elements in order to avoid NULL pointer dereference. Signed-off-by: Quentin Deslandes --- drivers/staging/vt6656/main_usb.c | 3 +++ 1 file changed

Re: [PATCH v3] staging: vt6656: returns error code on vnt_int_start_interrupt fail

2019-05-17 Thread Quentin Deslandes
On Fri, May 17, 2019 at 11:17:23AM +0200, Greg Kroah-Hartman wrote: > On Fri, May 17, 2019 at 07:53:49AM +0000, Quentin Deslandes wrote: > > Returns error code from 'vnt_int_start_interrupt()' so the device's private > > buffers will be correctly freed and 'struct ieee80211_hw'

[PATCH v3] staging: vt6656: returns error code on vnt_int_start_interrupt fail

2019-05-17 Thread Quentin Deslandes
Returns error code from 'vnt_int_start_interrupt()' so the device's private buffers will be correctly freed and 'struct ieee80211_hw' start function will return an error code. Signed-off-by: Quentin Deslandes --- v2: returns 'status' value to caller instead of removing it. v3: add patch version

[PATCH v2] staging: vt6656: returns error code on vnt_int_start_interrupt fail

2019-05-16 Thread Quentin Deslandes
Returns error code from 'vnt_int_start_interrupt()' so the device's private buffers will be correctly freed and 'struct ieee80211_hw' start function will return an error code. Signed-off-by: Quentin Deslandes --- drivers/staging/vt6656/int.c | 4 +++- drivers/staging/vt6656/int.h

[PATCH] staging: vt6656: returns error code on vnt_int_start_interrupt fail

2019-05-16 Thread Quentin Deslandes
Returns error code from 'vnt_int_start_interrupt()' so the device's private buffers will be correctly freed and 'struct ieee80211_hw' start function will return an error code. Signed-off-by: Quentin Deslandes --- v2: instead of removing status variable, returns its value to caller and handle

Re: [PATCH] staging: vt6656: remove unused variable

2019-05-16 Thread Quentin Deslandes
On Thu, May 16, 2019 at 11:39:51AM +0200, Greg Kroah-Hartman wrote: > On Thu, May 16, 2019 at 09:31:05AM +0000, Quentin Deslandes wrote: > > Fixed 'set but not used' warning message on a status variable. The > > called function returning the status code 'vnt_start_interrupt_urb(

Re: [PATCH] staging: vt6656: remove unused variable

2019-05-16 Thread Quentin Deslandes
On Thu, May 16, 2019 at 12:19:53PM +0200, Greg Kroah-Hartman wrote: > On Thu, May 16, 2019 at 09:50:38AM +0000, Quentin Deslandes wrote: > > On Thu, May 16, 2019 at 11:39:51AM +0200, Greg Kroah-Hartman wrote: > > > On Thu, May 16, 2019 at 09:31:05AM +, Quentin Deslandes wr

[PATCH] staging: vt6656: remove unused variable

2019-05-16 Thread Quentin Deslandes
Fixed 'set but not used' warning message on a status variable. The called function returning the status code 'vnt_start_interrupt_urb()' clean up after itself and the caller function 'vnt_int_start_interrupt()' does not returns any value. Signed-off-by: Quentin Deslandes --- drivers/staging