Re: [PATCH 3/4] staging: rtl8723bs: Remove comparisons to booleans in conditionals.

2019-10-10 Thread Dan Carpenter
eeds check if ap supports rx ampdu. */ > - if ((phtpriv->ampdu_enable == false) && (pregistrypriv->ampdu_enable == > 1)) { > + if (!(phtpriv->ampdu_enable) && pregistrypriv->ampdu_enable == 1) { Same. > if (pregistrypriv->wifi_sp

Re: [PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each

2019-10-10 Thread Dan Carpenter
; + xfi_direct_valid = xfi_indirect_valid; > + xaui_indirect_valid = 1; > + xaui_direct_valid = xaui_indirect_valid The original code is fine here. Just ignore checkpatch on this. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH 0/7] Fix various compilation issues with wfx driver

2019-10-09 Thread Dan Carpenter
ir heads. I suspected it might be a false positive but I wasn't sure either way and I try not to spend a lot of time reviewing those warnings. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v2 1/2] dmaengine: avalon: Intel Avalon-MM DMA Interface for PCIe

2019-10-09 Thread Dan Carpenter
On Wed, Oct 09, 2019 at 04:58:12PM +0200, Alexander Gordeev wrote: > On Wed, Oct 09, 2019 at 03:14:41PM +0300, Dan Carpenter wrote: > > > +config AVALON_DMA_PCI_VENDOR_ID > > > + hex "PCI vendor ID" > > > + default "0x1172" > > > + > &

Re: [staging:staging-testing 41/59] drivers/staging/wfx/main.c:47:14-21: ERROR: PTR_ERR applied after initialization to constant on line 42

2019-10-09 Thread Dan Carpenter
>> 51 ret = NULL; > > >> 52 } else { > > >> 53 dev_dbg(dev, "using gpio %d for %s\n", > > >> desc_to_gpio(ret), label); > > >> 54 } > > >> 55

Re: [PATCH] staging: rtl8723bs: hal: Fix memcpy calls

2019-10-09 Thread Dan Carpenter
On Tue, Oct 01, 2019 at 09:58:55PM +0300, Dan Carpenter wrote: > On Tue, Oct 01, 2019 at 06:13:21PM +0300, Denis Efremov wrote: > > Just found an official documentation to this issue: > > https://gcc.gnu.org/gcc-4.9/porting_to.html > > "Null pointer checks may be optimi

Re: [PATCH v2 0/3] staging: wfx: Make some functions static

2019-10-09 Thread Dan Carpenter
Thanks! regars, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH RFC v2 2/2] dmaengine: avalon: Intel Avalon-MM DMA Interface for PCIe test

2019-10-09 Thread Dan Carpenter
gt; + return 0; > + > +err: > + while (!kthread_should_stop()) > + cond_resched(); > + > + return ret; > +} > + > +struct kthread_xfer_rw_sg_data { > + struct dma_chan *chan; > + enum dma_data_direction dir; > + dma_addr_t dev_addr; > + struct scatterlist *sg; > + unsigned int sg_len; > + void (*xfer_callback)(void *dma_async_param); > +}; > + > +static int __kthread_xfer_rw_sg(void *_data) > +{ > + struct kthread_xfer_rw_sg_data *data = _data; > + > + return kthread_xfer_rw_sg(data->chan, data->dir, > + data->dev_addr, data->sg, data->sg_len, > + data->xfer_callback); > +} > + > +static int __xfer_rw_sg_smp(struct dma_chan *chan, > + enum dma_data_direction dir, > + dma_addr_t dev_addr, > + struct scatterlist *sg, unsigned int sg_len, > + void (*xfer_callback)(void *dma_async_param)) > +{ > + struct kthread_xfer_rw_sg_data data = { > + chan, dir, > + dev_addr, sg, sg_len, > + xfer_callback > + }; > + struct task_struct *task; > + struct task_struct **tasks; > + int nr_tasks = dmas_per_cpu * num_online_cpus(); > + int n, cpu; > + int ret = 0; > + int i = 0; > + > + tasks = kmalloc(sizeof(tasks[0]) * nr_tasks, GFP_KERNEL); kmalloc_array(). > + if (!tasks) > + return -ENOMEM; > + > + for (n = 0; n < dmas_per_cpu; n++) { > + for_each_online_cpu(cpu) { > + if (i >= nr_tasks) { > + ret = -ENOMEM; > + goto kthread_err; > + } > + > + task = kthread_create(__kthread_xfer_rw_sg, > + &data, "av-dma-sg-%d-%d", cpu, n); > + if (IS_ERR(task)) { > + ret = PTR_ERR(task); > + goto kthread_err; > + } > + > + kthread_bind(task, cpu); > + > + tasks[i] = task; > + i++; > + } > + } > + > + for (i = 0; i < nr_tasks; i++) > + wake_up_process(tasks[i]); > + > + /* > + * Run child kthreads until user sent a signal (i.e Ctrl+C) > + * and clear the signal to avid user program from being killed. > + */ > + schedule_timeout_interruptible(MAX_SCHEDULE_TIMEOUT); > + flush_signals(current); > + > +kthread_err: > + for (i = 0; i < nr_tasks; i++) > + kthread_stop(tasks[i]); This will Oops when you try free uninitialized data. The way to do error handling is: 1) Use good label names which say what the label does. "goto free_foo;" 2) Keep track of the most recently allocated thing. "foo" 3) Free most recent thing. That will free everything and it *won't* free things which haven't been allocated. Here it's complicated because we have to break out of a loop. The rules for loops are: 4) free the partial iteration before the goto. 5) free down to zero for (i = 0; i < cnt; i++) { foo = alloc(); if (!foo) goto unwind_loop; foo->bar = alloc(); if (!bar) { free(foo); goto unwind_loop; } foo->bar->baz = alloc(); if (!baz) { free(foo->bar); free(foo); goto unwind_loop; } array[i] = foo; } return 0; unwind_loop: while (--i >= 0) { free(array[i]->bar->baz); free(array[i]->bar); free(array[i]); } free(array); return -ENOMEM; My other comment would be that you're sacrificing a lot of readability to add debug code to this driver... It's hard to review. > + > + kfree(tasks); > + > + return ret; > +} regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH 1/3] staging: wfx: Make function 'sram_write_dma_safe', 'load_firmware_secure' static

2019-10-09 Thread Dan Carpenter
ne, but keep it consistent within the file. Here the style should be: static int sram_write_dma_safe(struct wfx_dev *wdev, u32 addr, const u8 *buf, size_t len) regards, dan carpenter ___ devel mailing list de...@linuxdriverp

Re: [PATCH v2 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver

2019-10-09 Thread Dan Carpenter
On Wed, Oct 09, 2019 at 02:30:32PM +0300, Dan Carpenter wrote: > > + platform = kzalloc(sizeof(*platform), GFP_KERNEL); > > + if (!platform) { > > + DRM_DEV_ERROR(dev, "failed to allocate driver data\n"); > > + ret = -ENOMEM; > > +

Re: [PATCH v2 1/2] dmaengine: avalon: Intel Avalon-MM DMA Interface for PCIe

2019-10-09 Thread Dan Carpenter
en; > + > + nr_descs++; > + if (nr_descs >= DMA_DESC_MAX) > + break; > + > + desc_id++; > + if (desc_id >= DMA_DESC_MAX) > + break; > + > + de

Re: [PATCH v2 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver

2019-10-09 Thread Dan Carpenter
Are you sure you sent the correct patch? This has many of the same style issues I mentioned in the previous email. The error handling in edid_read() is wrong. probe() will still crash if allocating the work queue fails. On Wed, Oct 09, 2019 at 09:28:02AM +, Xin Ji wrote: > The ANX7625 is an

[staging:staging-testing 55/111] drivers/staging/wfx/wfx.h:91 wdev_to_wvif() warn: potential spectre issue 'wdev->vif' [r] (local cap)

2019-10-09 Thread Dan Carpenter
-by: kbuild test robot Reported-by: Dan Carpenter New smatch warnings: drivers/staging/wfx/wfx.h:91 wdev_to_wvif() warn: potential spectre issue 'wdev->vif' [r] (local cap) drivers/staging/wfx/data_tx.c:479 wfx_tx_get_raw_link_id() warn: signedness bug returning &#x

Re: [PATCH] KPC2000: kpc2000_spi.c: Fix alignment and style problems.

2019-10-09 Thread Dan Carpenter
G_CONFIG && cs->conf_cache >= 0) I like these changes but Greg doesn't. So don't bother with this one. > return cs->conf_cache; > > val = readq(addr); The rest of the changes are fine. Split them into multiple patches and resend. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v3] staging: vc04_services: Avoid NULL comparison

2019-10-09 Thread Dan Carpenter
iq_2835_arm.c | 4 ++-- But this doesn't affect the final patch, and we can see all the information so it's fine. No need to resend. Reviewed-by: Dan Carpenter regards, dan carpenter ___ devel mailing list de...@linuxdriverproject

Re: [PATCH] staging: vchiq: don't leak kernel address

2019-10-08 Thread Dan Carpenter
On Tue, Oct 08, 2019 at 04:21:54PM +0200, Matteo Croce wrote: > On Tue, Oct 8, 2019 at 3:16 PM Dan Carpenter wrote: > > > > The subject doesn't match the patch. It should just be "remove useless > > printk". > > > > regards, > > dan ca

Re: [PATCH] staging: vchiq: don't leak kernel address

2019-10-08 Thread Dan Carpenter
The subject doesn't match the patch. It should just be "remove useless printk". regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH 6/7] staging: wfx: drop calls to BUG_ON()

2019-10-08 Thread Dan Carpenter
sizeof(msg->rx_mic_key), "inconsistent data"); That doesn't look too good still... The error message is sort of rubbish also. Anyway the operator goes on the first line. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH 4/7] staging: wfx: correctly cast data on big-endian targets

2019-10-08 Thread Dan Carpenter
r now, but in the future there shouldn't be a space after the cast. It's to mark that it's a high precedence operation. cpu_to_le32s((uint32_t *)&val); regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH 1/7] staging: wfx: simplify memory allocation in wfx_update_filtering()

2019-10-08 Thread Dan Carpenter
.oui = { 0x50, 0x6F, 0x9A }, Please don't do unrelated white space changes in their own patches. > }, { > .ie_id= WLAN_EID_HT_OPERATION, > .has_changed = 1, regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v2 0/6] staging: Remove a bounch set of set but not used variables

2019-10-08 Thread Dan Carpenter
Looks good. Thanks! Reviewed-by: Dan Carpenter regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] staging: wlan-ng: p80211wep.c: use lib/crc32

2019-10-07 Thread Dan Carpenter
On Mon, Oct 07, 2019 at 06:15:23PM +0200, Thomas Meyer wrote: > Dan Carpenter writes: > > > On Sun, Oct 06, 2019 at 04:07:45PM +0200, Thomas Meyer wrote: > >> Use lib/crc32 instead of another implementation. > >> > >> Signed-off-by: Thomas Meyer >

Re: [PATCH] staging: rtl8712: Add comment to lock declaration

2019-10-07 Thread Dan Carpenter
nlock to protect interrupt request */ But in this case, the comment isn't correct so please just leave it as-is until someone can fix the locking. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH 2/6] staging: sm750fb: Remove set but not used variable 'uiActualPixelClk'

2019-10-07 Thread Dan Carpenter
On Tue, Oct 08, 2019 at 09:06:11AM +0300, Dan Carpenter wrote: > On Tue, Oct 08, 2019 at 01:38:58PM +0800, zhengbin wrote: > > diff --git a/drivers/staging/sm750fb/ddk750_mode.c > > b/drivers/staging/sm750fb/ddk750_mode.c > > index 9722692..e0230f4 100644 > > --

Re: [PATCH 2/6] staging: sm750fb: Remove set but not used variable 'uiActualPixelClk'

2019-10-07 Thread Dan Carpenter
ULT_INPUT_CLOCK; > pll.clock_type = clock; > > - uiActualPixelClk = sm750_calc_pll_value(parm->pixel_clock, &pll); > + sm750_calc_pll_value(parm->pixel_clock, &pll); Get rid of this function as well. regards, dan carpenter __

Re: [PATCH 1/6] staging: bcm2835-audio: Remove set but not used variable 'status'

2019-10-07 Thread Dan Carpenter
&m, sizeof(m), &msg_len, VCHI_FLAGS_NONE); This looks like a bug in the code. flags is VCHI_FLAGS_NONE so it can return -1 and we should check for that. > if (m.type == VC_AUDIO_MSG_TYPE_RESULT) { regards, dan carpenter _

[staging:staging-next 50/93] drivers/staging/wfx/debug.c:112 wfx_send_hif_msg_read() warn: maybe return -EFAULT instead of the bytes remaining?

2019-10-07 Thread Dan Carpenter
-by: kbuild test robot Reported-by: Dan Carpenter smatch warnings: drivers/staging/wfx/debug.c:112 wfx_send_hif_msg_read() warn: maybe return -EFAULT instead of the bytes remaining? # https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/?id

Re: [PATCH] staging: rtl8712: align arguments with open parenthesis in file rtl8712_led.c

2019-10-07 Thread Dan Carpenter
^^ Delete these extra spaces. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] staging: wlan-ng: p80211wep.c: use lib/crc32

2019-10-07 Thread Dan Carpenter
w it because I don't have the relevant background and because I'm a little bit stupid. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH 1/5] staging: rtl8723bs: Remove set but not used variable 'i'

2019-10-07 Thread Dan Carpenter
i = _rtw_pktfile_read(&pktfile, (u8 *)ðerhdr, ETH_HLEN); > + (void)_rtw_pktfile_read(&pktfile, (u8 *)ðerhdr, ETH_HLEN); Don't add this "(void)" here. There is no need and it looks ugly. _rtw_pktfile_read(&pk

Re: [PATCH] staging: rtl8712: fix boundary condition for n

2019-10-03 Thread Dan Carpenter
On Wed, Oct 02, 2019 at 10:35:19PM +0530, Rohit Sarkar wrote: > Now that snprintf is replaced by scnprintf n >= MAX_WPA_IE_LEN doesn't > make sense as the maximum value n can take is MAX_WPA_IE_LEN. > > Signed-off-by: Rohit Sarkar > --- Thanks! Reviewed-by: Dan C

Re: [PATCH] staging: exfat: use bdev_sync function directly where needed

2019-10-03 Thread Dan Carpenter
Or we could apply your other patch which trumps both this patch and the patch to the TODO. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] staging: exfat: use bdev_sync function directly where needed

2019-10-03 Thread Dan Carpenter
think that it's not really useful. Future auditors should look for places which call fs_set_vol_flags(sb, VOL_CLEAN); instead. That's exactly the places which call fs_sync(). regards, dan carpenter ___ devel mailing list de...@linuxdr

Re: [PATCH] drivers/staging/exfat - explain the fs_sync() issue in TODO

2019-10-03 Thread Dan Carpenter
On Wed, Oct 02, 2019 at 03:01:35PM -0400, Valdis Klētnieks wrote: > We've seen several incorrect patches for fs_sync() calls in the exfat driver. > Add code to the TODO that explains this isn't just a delete code and refactor, > but that actual analysis of when the filesystem should be flushed to d

Re: [PATCH] staging: wlan-ng: fix uninitialized variable

2019-10-03 Thread Dan Carpenter
Maybe in olden times "result" used to save positive error codes instead of negative error codes but now it's just negatives and zero on success. There is no reason for the exit label either, we could just return directly. So could you redo it and get rid of "result"

Re: [PATCH] staging: exfat: use bdev_sync function directly where needed

2019-10-03 Thread Dan Carpenter
direct call to bdev_sync() where > needed and removes fs_sync definition. > > Signed-off-by: Saiyam Doshi Reviewed-by: Dan Carpenter regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproj

Re: [PATCH] staging: rtl8712: Replace snprintf with scnprintf

2019-10-02 Thread Dan Carpenter
On Wed, Oct 02, 2019 at 05:12:14PM +0530, Rohit Sarkar wrote: > On Wed, Oct 02, 2019 at 01:57:22PM +0300, Dan Carpenter wrote: > > > > We could leave it as is or change it to "MAX_WPA_IE_LEN - 1". But I > > feel like the default should be to leave it as is un

Re: [PATCH] staging: rtl8712: Replace snprintf with scnprintf

2019-10-02 Thread Dan Carpenter
On Wed, Oct 02, 2019 at 10:03:51AM +0530, Rohit Sarkar wrote: > On Tue, Oct 01, 2019 at 10:00:56PM +0300, Dan Carpenter wrote: > > > > No. scnprintf() returns the number of characters *not counting the > > NUL terminator*. So it can be a maximum of MAX_WPA_IE_LEN - 1. >

Re: [PATCH] staging: rtl8723bs: os_dep: Remove return variables

2019-10-02 Thread Dan Carpenter
Someone already sent a patch to remove these functions. Generally there should only be empty functions like this in a .h file. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman

Re: [RESEND PATCH] staging: rtl8192u: Fix indentation for cleaner code

2019-10-02 Thread Dan Carpenter
er > > > readability as suggested by Dan Carpenter. > > > > Please wrap your lines at 72 columns. > > > > > I will keep this in mind. I was under the impression that the line > length must be 80 columns > but will make the change immediately. To be able to

Re: [PATCH] staging: rtl8712: Replace snprintf with scnprintf

2019-10-01 Thread Dan Carpenter
On Tue, Oct 01, 2019 at 11:09:26PM +0530, Rohit Sarkar wrote: > On Tue, Oct 01, 2019 at 11:45:14AM +0300, Dan Carpenter wrote: > > > diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > > b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > > index b08

Re: [PATCH] staging: rtl8723bs: hal: Fix memcpy calls

2019-10-01 Thread Dan Carpenter
ted as non-NULL. extern void *memcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); We aren't going to do that in the kernel. A second difference is that in the kernel we use -fno-delete-null-pointer-checks so it doesn&#

Re: [PATCH] staging: rtl8712: Replace snprintf with scnprintf

2019-10-01 Thread Dan Carpenter
On Wed, Sep 11, 2019 at 12:25:03AM +0530, Rohit Sarkar wrote: > Resending as I made a typo in Larry's email id. > I commented on the earlier email, but this email doesn't apply with `git am` so it would be difficult for Larry to review it. regard

Re: [PATCH] staging: rtl8723bs: hal: Fix memcpy calls

2019-10-01 Thread Dan Carpenter
(). In the kernel there are lots of places which do a zero size memcpy(). The glibc attitude is "the standard allows us to put knives here" so let's put knives everywhere in the path. And the GCC attitude is let's silently remove NULL checks instead of just print

Re: [PATCH] Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc

2019-10-01 Thread Dan Carpenter
address this issue. > > Fixes: c296d5f9957c ("staging: fbtft: core support") > Signed-off-by: Navid Emamdoost Looks good. Reviewed-by: Dan Carpenter regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://d

Re: [PATCH 2/3] Staging: exfat: exfat_super.c: fixed multiple coding style issues with camelcase and parentheses

2019-10-01 Thread Dan Carpenter
_ON() and added WARN_ON(). > Removed unnecessary parentheses: > *(dir_entry->Name) - > *dir_entry->Name Do these other two things in separate patches. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH 2/3] Staging: exfat: exfat_super.c: fixed multiple coding style issues with camelcase and parentheses

2019-10-01 Thread Dan Carpenter
On Sat, Sep 28, 2019 at 07:22:33PM -0500, Jesse Barton wrote: > Fixed coding style issues with camelcase on functions and various parentheses > that were not needed > Do this as two separate patches. regards, dan carpenter ___ devel mailin

Re: [PATCH 3/3] Staging: exfat: exfat_super.c Fixed coding style issues.

2019-10-01 Thread Dan Carpenter
file_id_t *fid) I think now checkpatch will complain that the line is too long? What we want here is: static int ffs_create_file(struct inode *inode, char *path, u8 mode, struct file_id_t *fid) [tab][tab][tab][space][space][space]s

Re: [PATCH] staging: rtl8188eu: fix null dereference when kzalloc fails

2019-10-01 Thread Dan Carpenter
ry for HAL DATA\n"); 353 > padapter->HalData = kzalloc(sizeof(struct hal_data_8188e), GFP_KERNEL); > - if (!padapter->HalData) > - DBG_88E("cant not alloc memory for HAL DATA\n"); > + if (!padapter->HalData)

Re: [PATCH] staging: rtl8723bs: Variable rf_type in function rtw_cfg80211_init_wiphy() could be uninitialized

2019-10-01 Thread Dan Carpenter
ble for human beings as well. Another option would be to just delete the "if (padapter->HalFunc.GetHwRegHandler)" check which would also silence the false positive. A third option would be to add "rtw_hal_get_hwreg 2" to the

Re: [PATCH] staging: rtl8712: Replace snprintf with scnprintf

2019-10-01 Thread Dan Carpenter
It checks for overflow here. This check is impossible now and doesn't make sense. The other loop is similar. > break; regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v2] staging: rtl8188eu: remove dead code/vestigial do..while loop

2019-09-27 Thread Dan Carpenter
Looks good. Thanks! regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v2] staging: olpc_dcon: fix wrong dependencies in Kconfig file

2019-09-25 Thread Dan Carpenter
Thanks! regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] staging: olpc_dcon: fix wrong dependencies in Kconfig file

2019-09-25 Thread Dan Carpenter
nfig > @@ -3,7 +3,7 @@ config FB_OLPC_DCON > tristate "One Laptop Per Child Display CONtroller support" > depends on OLPC && FB > depends on I2C > - depends on (GPIO_CS5535 || ACPI) > + depends on (GPIO_CS

Re: NACK: [PATCH] staging: rtl8188eu: remove dead code in do-while conditional step

2019-09-24 Thread Dan Carpenter
replies to the original email and we apply the v1 patch that's the only thing to avoid. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] staging: rtl8188eu: remove dead code in do-while conditional step

2019-09-23 Thread Dan Carpenter
s, then this one is OK. It has to be done in one step. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] staging: rtl8188eu: remove dead code in do-while conditional step

2019-09-23 Thread Dan Carpenter
E_MAX_H2C_BOX_NUMS; > > - } while ((!bcmd_down) && (retry_cnts--)); > + } while (!bcmd_down); Just get rid of the whole do while loop, because it just goes through one time. It doesn't loop. Get rid of bcmd_down as well. regards, dan carpenter _

Re: [PATCH] staging: rtl8723bs: os_dep: Remove unused variable

2019-09-23 Thread Dan Carpenter
union iwreq_data *wrqu, char > *extra) > { > - int ret = 0; > - return ret; > + return 0; Someone already sent a better patch which just deletes the whole function. https://marc.info/?l=linux-kernel&m=156879878226402&w=2 regards, dan

Re: [PATCH] staging: rtl8723bs: core: Drop condition with no effect

2019-09-23 Thread Dan Carpenter
d->cmdcode, cmd_process_time); > /* rtw_warn_on(1); */ This is indented too far now. You may was well delete the /* rtw_warn_on(1); */ line as well. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v1 2/2] drm/bridge: anx7625: Add anx7625 MIPI to DP bridge driver

2019-09-23 Thread Dan Carpenter
I wish you would think more about the error codes that you're returning. Most functions do "ret |= frob()." which ORs the error codes together, and results in a nonsense negative error code. But then some functions return 1 on error and zero on success which is sometimes a bug, sometimes confusing

Re: [PATCH v2] drivers:staging:rtl8723bs: Removed unneeded variables

2019-09-18 Thread Dan Carpenter
ions and replaced them with NULL in function array. Thanks! regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] staging: exfat: add exfat filesystem code to

2019-09-18 Thread Dan Carpenter
On Wed, Sep 18, 2019 at 06:53:49PM +0900, Ju Hyung Park wrote: > Hi Dan, > > On Wed, Sep 18, 2019 at 6:27 PM Dan Carpenter > wrote: > > Put it in drivers/staging/sdfat/. > > It'll conflict with the current exfat staging drivers. Use Kconfig. > And moreover,

Re: [PATCH] staging: exfat: add exfat filesystem code to

2019-09-18 Thread Dan Carpenter
the fixes into staging. The staging tree is going to have tons and tons of white space fixes so backports are a pain. All development needs to be upstream first where the staging driver is upstream. Otherwise we should just wait for Samsung to get it read to be merged in fs/ and not through the s

Re: [PATCH] drivers:staging:rtl8723bs: Removed unneeded variables

2019-09-17 Thread Dan Carpenter
union iwreq_data *wrqu, char > *extra) > { > - int ret = 0; > - return ret; > + return 0; > } Just get rid of the whole function. Replace the pointer in the function array with a NULL. regards, dan carpenter ___

Re: [PATCH] staging: comedi: drivers: prevent memory leak

2019-09-16 Thread Dan Carpenter
if (ret >= 0) 998 ret = comedi_device_postconfig(dev); 999 if (ret < 0) { 1000 comedi_device_detach(dev); ^ 1001 module_put(driv->module); 1002 } 1003

Re: [PATCH] staging: r8188eu: replace rtw_malloc() with it's definition

2019-09-14 Thread Dan Carpenter
On Sat, Sep 14, 2019 at 06:18:03PM +0300, Ivan Safonov wrote: > On 9/10/19 2:59 PM, Dan Carpenter wrote: > > On Sun, Sep 08, 2019 at 12:00:26PM +0300, Ivan Safonov wrote >> rtw_malloc > > prevents the use of kmemdup/kzalloc and others. > > > >

Re: [PATCH v5] Staging: exfat: Avoid use of strcpy

2019-09-12 Thread Dan Carpenter
You did it. Well done. :P Reviewed-by: Dan Carpenter regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v4] Staging: exfat: avoid use of strcpy

2019-09-11 Thread Dan Carpenter
No worries... We all have days like that occasionally. :P regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v4] Staging: exfat: avoid use of strcpy

2019-09-11 Thread Dan Carpenter
d to highlight whitespace at the end of a line. I don't remember how it's done now but I googled it for you. https://vim.fandom.com/wiki/Highlight_unwanted_spaces regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] staging: vhciq_core: replace snprintf with scnprintf

2019-09-11 Thread Dan Carpenter
ot;? A lot of times it's really easy to see that the uses are safe, so snprintf() is fine in that case. If it's not obviously safe then change it. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdr

Re: [PATCH] staging: vhciq_core: replace snprintf with scnprintf

2019-09-11 Thread Dan Carpenter
et a lot of stalls, then that looks like it could lead to a read overflow (an information leak). Either way this does make the code a bit easier to audit so it seems like a nice cleanup. Next time though, I really would prefer if you put this sort analysis in yo

Re: [PATCH v3] Staging: exfat: Avoid use of strcpy

2019-09-11 Thread Dan Carpenter
^^^ Get rid of this. > return FFS_INVALIDPATH; > > - strcpy(name_buf, path); > + if (strscpy(name_buf, path, sizeof(name_buf)) < 0) > + return FFS_INVALIDPATH; regards, dan

Re: [PATCH v2] Staging: exfat: Avoid use of strcpy

2019-09-11 Thread Dan Carpenter
On Wed, Sep 11, 2019 at 12:24:23PM +0200, Sandro Volery wrote: > > > > On 11 Sep 2019, at 12:06, Dan Carpenter wrote: > > > > On Wed, Sep 11, 2019 at 11:42:19AM +0200, Sandro Volery wrote: > >> Use strscpy instead of strcpy in exfat_core.c, and add a check

Re: [PATCH] Staging: octeon: Avoid several usecases of strcpy

2019-09-11 Thread Dan Carpenter
On Wed, Sep 11, 2019 at 11:21:44AM +0200, Sandro Volery wrote: > > On 11 Sep 2019, at 11:17, Dan Carpenter wrote: > > > > On Wed, Sep 11, 2019 at 11:04:38AM +0200, Sandro Volery wrote: > >> > >> > >>>> On 11 Sep 2019, at 10:52, Dan Carpent

Re: [PATCH v2] Staging: exfat: Avoid use of strcpy

2019-09-11 Thread Dan Carpenter
^^ Delete this as it is no longer required. > return FFS_INVALIDPATH; > > - strcpy(name_buf, path); > + if (strscpy(name_buf, path, sizeof(name_buf)) < 0) > + return FFS_INVALIDPATH; regards, dan ca

Re: [PATCH] Staging: octeon: Avoid several usecases of strcpy

2019-09-11 Thread Dan Carpenter
On Wed, Sep 11, 2019 at 11:04:38AM +0200, Sandro Volery wrote: > > > > On 11 Sep 2019, at 10:52, Dan Carpenter wrote: > > > > On Wed, Sep 11, 2019 at 08:23:59AM +0200, Sandro Volery wrote: > >> strcpy was used multiple times in strcpy to write into dev->nam

Re: [PATCH] Staging: octeon: Avoid several usecases of strcpy

2019-09-11 Thread Dan Carpenter
"pow%d"); > + strscpy(dev->name, "pow%d", sizeof(dev->name)); Is there a program which is generating a warning for this code? We know that "pow%d" is 6 characters and static analysis tools can understand this code fine so we kn

Re: [PATCH] Staging: exfat: Avoid use of strcpy

2019-09-11 Thread Dan Carpenter
wow, the "name_buf" is a shared buffer. wow wow wow. This seems very racy. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: staging: exfat: issue with FFS_MEDIAERR error return assignment

2019-09-10 Thread Dan Carpenter
On Tue, Sep 10, 2019 at 01:58:35PM +0100, Colin Ian King wrote: > On 10/09/2019 13:44, Dan Carpenter wrote: > > On Fri, Aug 30, 2019 at 07:38:00PM +0100, Colin Ian King wrote: > >> Hi, > >> > >> Static analysis on exfat with Coverity has picked up an assignment

Re: staging: exfat: issue with FFS_MEDIAERR error return assignment

2019-09-10 Thread Dan Carpenter
= p_fs->root_dir) && > 1752(fid->entry == -1)) { > 1753if (p_fs->dev_ejected) Idealy we would have both a filename and a function name but this email doesn't have either so no one knows what

Re: [PATCH v3] Staging: gasket: Use temporaries to reduce line length.

2019-09-10 Thread Dan Carpenter
Looks good. Reviewed-by: Dan Carpenter regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] staging: r8188eu: replace rtw_malloc() with it's definition

2019-09-10 Thread Dan Carpenter
e = kmalloc(remainder_ielen, in_interrupt() > ? GFP_ATOMIC : GFP_KERNEL); ^ This stuff isn't right. It really should be checking if spinlocks are held or IRQs are disabled. And the only way to do that is by auditing the callers. (The

Re: [PATCH] staging: android: ion: Replace strncpy() for stracpy()

2019-09-10 Thread Dan Carpenter
ame, MAX_HEAP_NAME); > - hdata.name[sizeof(hdata.name) - 1] = '\0'; > + stracpy(hdata.name, heap->name, MAX_HEAP_NAME); stracpy() only takes two arguments. This doesn't compile. regards, dan carpenter ___ d

Re: [PATCH] Staging: wlan-ng: parenthesis at end of line fix

2019-09-10 Thread Dan Carpenter
( > request->channels[i]->center_freq); No, that looks even worse. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v2 1/2] staging: rtl8192u: Add or remove spaces to fix style issues

2019-09-10 Thread Dan Carpenter
t signing your paychecks. Take as long as you want. :P regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v2] Staging: gasket: Use temporaries to reduce line length.

2019-09-10 Thread Dan Carpenter
10 Sep 2019, at 07:06, Sandro Volery wrote: > > > > Using temporaries for gasket_page_table entries to remove scnprintf() > > statements and reduce line length, as suggested by Joe Perches. Thanks! ^^^^^^

Re: [PATCH] Fixed parentheses malpractice in apex_driver.c

2019-09-07 Thread Dan Carpenter
On Sat, Sep 07, 2019 at 04:48:21PM +0200, Sandro Volery wrote: > > Joe's comments are, of course, correct as well. > > > > regards, > > dan carpenter > > > > I'll take a look at Joe's suggestions too sometime tonight. I'd feel kinda &

Re: [PATCH] Fixed parentheses malpractice in apex_driver.c

2019-09-07 Thread Dan Carpenter
ut off line > > Signed-off-by: Sandro Volery > --- ^^^ Put it here. It will be removed when we apply the patch so it won't be recorded in the git log. > drivers/staging/gasket/apex_driver.c | 9 ++--- > 1 file changed, 6 insertions(+), 3 deletions(-) Joe's comments

Re: [PATCH] staging: rtl8723bs: hal: remove redundant assignment to variable n

2019-09-05 Thread Dan Carpenter
It would be better to remove "n" altogether. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[PATCH] staging: exfat: Fix two missing unlocks on error paths

2019-09-04 Thread Dan Carpenter
These two error paths need to unlock before we can return. Signed-off-by: Dan Carpenter --- drivers/staging/exfat/exfat_super.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c index

Re: [PATCH v3 6/7] erofs: remove all likely/unlikely annotations

2019-08-31 Thread Dan Carpenter
We don't really require benchmarks, just that a reasonable person would think it might make a difference. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v3 6/7] erofs: remove all likely/unlikely annotations

2019-08-30 Thread Dan Carpenter
On Fri, Aug 30, 2019 at 02:25:13PM +0800, Chao Yu wrote: > On 2019/8/30 11:36, Gao Xiang wrote: > > As Dan Carpenter suggested [1], I have to remove > > all erofs likely/unlikely annotations. > > > > [1] https://lore.kernel.org/linux-fsdevel/20190829154346.GK23584@

Re: [PATCH v3 6/7] erofs: remove all likely/unlikely annotations

2019-08-30 Thread Dan Carpenter
On Fri, Aug 30, 2019 at 11:36:42AM +0800, Gao Xiang wrote: > As Dan Carpenter suggested [1], I have to remove > all erofs likely/unlikely annotations. > > [1] https://lore.kernel.org/linux-fsdevel/20190829154346.GK23584@kadam/ > Reported-by: Dan Carpenter > Signed

Re: [PATCH] staging: exfat: add exfat filesystem code to staging

2019-08-30 Thread Dan Carpenter
On Fri, Aug 30, 2019 at 04:43:33PM +0800, Gao Xiang wrote: > Hi Dan, > > On Fri, Aug 30, 2019 at 11:34:45AM +0300, Dan Carpenter wrote: > > On Fri, Aug 30, 2019 at 12:04:41AM +0800, Gao Xiang wrote: > > > Anyway, I'm fine to delete them all if you like, but I t

Re: [PATCH] staging: exfat: add exfat filesystem code to staging

2019-08-30 Thread Dan Carpenter
ng to be expensive. The likely/unlikely annotations should be used in places a reasonable person thinks it will make a difference to benchmarks. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] staging: exfat: add exfat filesystem code to staging

2019-08-29 Thread Dan Carpenter
bout so I'm fine with removing all of them in one go. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] staging: exfat: add exfat filesystem code to staging

2019-08-29 Thread Dan Carpenter
On Thu, Aug 29, 2019 at 01:18:10PM +0200, Greg Kroah-Hartman wrote: > It could always use more review, which the developers asked for > numerous times. I stopped commenting on erofs style because all the likely/unlikely() nonsense is a pet peeve. regards, dan car

Re: [PATCH] staging: erofs: using switch-case while checking the inode type.

2019-08-29 Thread Dan Carpenter
oes "sensitive" mean here? Now that it's out of staging we aren't applying clean up patches? regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] staging: erofs: using switch-case while checking the inode type.

2019-08-29 Thread Dan Carpenter
quot;. > and I will review it then. > > p.s. if someone argues here or there, there will be endless > issues since there is no standard at all. More complaining... It doesn't matter if you can find ext4 that looks like dog poop, that's irrelevant. regards, dan carpenter ___

[PATCH] staging: greybus: light: fix a couple double frees

2019-08-29 Thread Dan Carpenter
e handled this part fine and did not cause a use after free but it was sort of complicated to read. Fixes: 2870b52bae4c ("greybus: lights: add lights implementation") Signed-off-by: Dan Carpenter --- drivers/staging/greybus/light.c | 12 ++-- 1 file changed, 6 insertions(+), 6

<    2   3   4   5   6   7   8   9   10   11   >