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

2019-10-10 Thread Dan Carpenter
then you can still have my Reviewed-by I guess. Reviewed-by: Dan Carpenter regards, dan carpenter

Re: [PATCH v2 0/4] staging: rtl8723bs: Style clean-up in rtw_mlme.c

2019-10-10 Thread Dan Carpenter
gt; original cover letter and provides a clearer subject line. The cover letter isn't stored in the git log so spelling is not important. The original subjects were fine as well. regards, dan carpenter

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

2019-10-10 Thread Dan Carpenter
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_spec == 1) { > /* remove this part because testbed AP should disable > RX AMPDU */ > /* phtpriv->ampdu_enable = false; */ regards, dan carpenter

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

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

2019-10-09 Thread Dan Carpenter
) warn: inconsistent returns > 'sem:>scan.lock' > > I also consider it as a false positive. Yeah. I thought it might be. The beauty of 0day bot is that normally the warnings come really quick after the original author wrote the code so it's fresh in their heads. I suspected it might be

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: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Dan Carpenter
On Wed, Oct 09, 2019 at 09:31:41AM -0700, Nick Desaulniers wrote: > On Wed, Oct 9, 2019 at 7:30 AM Dan Carpenter wrote: > > > > On Wed, Oct 09, 2019 at 04:21:20PM +0200, Rasmus Villemoes wrote: > > > On 09/10/2019 15.56, Dan Carpenter wrote: > > > > That

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] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Dan Carpenter
On Wed, Oct 09, 2019 at 04:21:20PM +0200, Rasmus Villemoes wrote: > On 09/10/2019 15.56, Dan Carpenter wrote: > > That's because glibc strlen is annotated with __attribute_pure__ which > > means it has no side effects. > > I know, except it has nothing to do with gl

Re: [PATCH] string.h: Mark 34 functions with __must_check

2019-10-09 Thread Dan Carpenter
c:5:2: warning: statement with no effect [-Wunused-value] > strlen(s); > ^ That's because glibc strlen is annotated with __attribute_pure__ which means it has no side effects. regards, dan carpenter

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

2019-10-09 Thread Dan Carpenter
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, > + , "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

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
+ src += xfer_len; > + > + len -= xfer_len; > + } > + > + *_set = set; > + > + return nr_descs; > +} > + > +int setup_descs_sg(struct dma_desc *descs, unsigned int desc_id, > +enum dma_data_direction direction, > +dma_addr_t dev_addr, > +struct scatterlist *__sg, unsigned int __sg_len, > +struct scatterlist *sg_start, unsigned int sg_offset, > +struct scatterlist **_sg_stop, unsigned int *_sg_set) > +{ > + struct scatterlist *sg; > + dma_addr_t sg_addr; > + unsigned int sg_len; > + unsigned int sg_set; > + int nr_descs = 0; > + int ret; > + int i; > + > + /* > + * Find the SGE that the previous xfer has stopped on - > + * it should exist. > + */ > + for_each_sg(__sg, sg, __sg_len, i) { > + if (sg == sg_start) > + break; > + > + dev_addr += sg_dma_len(sg); > + } > + > + if (WARN_ON(i >= __sg_len)) > + return -EINVAL; > + > + /* > + * The offset can not be longer than the SGE length. > + */ > + sg_len = sg_dma_len(sg); > + if (WARN_ON(sg_len < sg_offset)) > + return -EINVAL; > + > + /* > + * Skip the starting SGE if it has been fully transmitted. > + */ > + if (sg_offset == sg_len) { > + if (WARN_ON(sg_is_last(sg))) > + return -EINVAL; > + > + dev_addr += sg_len; > + sg_offset = 0; > + > + i++; > + sg = sg_next(sg); > + } > + > + /* > + * Setup as many SGEs as the controller is able to transmit. > + */ > + BUG_ON(i >= __sg_len); > + for (; i < __sg_len; i++) { > + sg_addr = sg_dma_address(sg); > + sg_len = sg_dma_len(sg); > + > + if (sg_offset) { > + if (unlikely(sg_len <= sg_offset)) { > + BUG(); > + return -EINVAL; > + } > + > + dev_addr += sg_offset; > + sg_addr += sg_offset; > + sg_len -= sg_offset; > + > + sg_offset = 0; > + } > + > + ret = setup_descs(descs, desc_id, direction, > + dev_addr, sg_addr, sg_len, _set); > + if (ret < 0) > + return ret; > + > + if (unlikely((desc_id + ret > DMA_DESC_MAX) || > + (nr_descs + ret > DMA_DESC_MAX))) { > + BUG(); > + return -ENOMEM; > + } > + > + nr_descs += ret; > + desc_id += ret; > + > + if (desc_id >= DMA_DESC_MAX) > + break; We already checked for this. > + > + if (unlikely(sg_len != sg_set)) { > + BUG(); > + return -EINVAL; > + } > + > + if (sg_is_last(sg)) > + break; > + > + descs += ret; > + dev_addr += sg_len; > + > + sg = sg_next(sg); > + } > + regards, dan carpenter

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

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

2019-10-09 Thread Dan Carpenter
FIG && 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

Re: [PATCH] uverbs: prevent potential underflow

2019-10-09 Thread Dan Carpenter
On Tue, Oct 08, 2019 at 04:44:25PM -0300, Jason Gunthorpe wrote: > On Sat, Oct 05, 2019 at 08:23:37AM +0300, Dan Carpenter wrote: > > The issue is in drivers/infiniband/core/uverbs_std_types_cq.c in the > > UVERBS_HANDLER(UVERBS_METHOD_CQ_CREATE) func

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 carp

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

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

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

2019-10-08 Thread Dan Carpenter
re shouldn't be a space after the cast. It's to mark that it's a high precedence operation. cpu_to_le32s((uint32_t *)); regards, dan carpenter

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

Re: [PATCH] iio: imu: adis16480: clean up a condition

2019-10-07 Thread Dan Carpenter
On Mon, Oct 07, 2019 at 10:21:07AM +0100, Jonathan Cameron wrote: > On Sun, 6 Oct 2019 21:14:40 +0300 > Dan Carpenter wrote: > > > On Sun, Oct 06, 2019 at 09:51:33AM +0100, Jonathan Cameron wrote: > > > On Thu, 26 Sep 2019 14:36:30 +0300 > > > Dan Carpenter wr

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

Re: [PATCH] iio: imu: adis16480: clean up a condition

2019-10-06 Thread Dan Carpenter
On Sun, Oct 06, 2019 at 09:51:33AM +0100, Jonathan Cameron wrote: > On Thu, 26 Sep 2019 14:36:30 +0300 > Dan Carpenter wrote: > > > On Thu, Sep 26, 2019 at 11:06:39AM +, Ardelean, Alexandru wrote: > > > On Thu, 2019-09-26 at 11:10 +0300, Dan Carpenter wr

[PATCH] uverbs: prevent potential underflow

2019-10-04 Thread Dan Carpenter
could potentially lead to an array underflow. My concern would be where cq->vector is used in the create_cq() function from the cxgb4 driver. Fixes: 9ee79fce3642 ("IB/core: Add completion queue (cq) object actions") Signed-off-by: Dan Carpenter --- drivers/infiniband/core/uverbs.h

[PATCH] ASoC: fsl_mqs: Fix error handling in probe

2019-10-04 Thread Dan Carpenter
s: 9e28f6532c61 ("ASoC: fsl_mqs: Add MQS component driver") Signed-off-by: Dan Carpenter --- sound/soc/fsl/fsl_mqs.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/sound/soc/fsl/fsl_mqs.c b/sound/soc/fsl/fsl_mqs.c index c1619a553514.

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

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

2019-10-03 Thread Dan Carpenter
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

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

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

2019-10-03 Thread Dan Carpenter
aybe 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" entirely? Otherwise it just causes more bugs like this. regards, dan carpenter

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

2019-10-03 Thread Dan Carpenter
kes direct call to bdev_sync() where > needed and removes fs_sync definition. > > Signed-off-by: Saiyam Doshi Reviewed-by: Dan Carpenter regards, dan carpenter

Re: [PATCH] net: stmmac: xgmac: add missing parentheses to fix precendence error

2019-10-02 Thread Dan Carpenter
On Wed, Oct 02, 2019 at 02:53:17PM +0100, Colin Ian King wrote: > On 02/10/2019 14:42, Dan Carpenter wrote: > > On Wed, Oct 02, 2019 at 04:33:57PM +0300, Dan Carpenter wrote: > >> On Wed, Oct 02, 2019 at 12:08:49PM +0100, Colin King wrote: > >>> From: Colin Ian Ki

Re: [PATCH] net: stmmac: xgmac: add missing parentheses to fix precendence error

2019-10-02 Thread Dan Carpenter
On Wed, Oct 02, 2019 at 04:33:57PM +0300, Dan Carpenter wrote: > On Wed, Oct 02, 2019 at 12:08:49PM +0100, Colin King wrote: > > From: Colin Ian King > > > > The expression !(hw_cap & XGMAC_HWFEAT_RAVSEL) >> 10 is always zero, so > > the masking opera

Re: [PATCH] net: stmmac: xgmac: add missing parentheses to fix precendence error

2019-10-02 Thread Dan Carpenter
GMAC_HWFEAT_TSSEL) >> 12; > dma_cap->av = (hw_cap & XGMAC_HWFEAT_AVSEL) >> 11; > - dma_cap->av &= !(hw_cap & XGMAC_HWFEAT_RAVSEL) >> 10; > + dma_cap->av &= !((hw_cap & XGMAC_HWFEAT_RAVSEL) >> 10); There is no point to the shift at all. regards, dan carpenter

Re: [PATCH] pwm: sun4i: redundant assignment to variable pval

2019-10-02 Thread Dan Carpenter
On Wed, Oct 02, 2019 at 04:25:06PM +0300, Dan Carpenter wrote: > On Wed, Oct 02, 2019 at 11:08:44AM +0100, Colin King wrote: > > From: Colin Ian King > > > > Variable pval is being assigned a value that is never read. The > > assignment is redundant and hence can be

Re: [PATCH] pwm: sun4i: redundant assignment to variable pval

2019-10-02 Thread Dan Carpenter
/* >* When not using any prescaler, the clock period in nanoseconds >* is not an integer so round it half up instead of Are you sure? It looks used to me. regards, dan carpenter

Re: [PATCH] libertas: remove redundant assignment to variable ret

2019-10-02 Thread Dan Carpenter
wdev->ssid instead of priv->mesh_ssid"). The return value was never used so it's not clear what returning 1 vs 0 was supposed to mean. lbs_init_mesh() should just be a void function. Reviewed-by: Dan Carpenter regards, dan carpenter

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't delete the NULL checks. regards, dan carpenter

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

2019-10-01 Thread Dan Carpenter
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 printing a warning that the NULL check isn't required... It could really make someone despondent. regards, dan carpenter

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

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

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

2019-10-01 Thread Dan Carpenter
uct > 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]struct file_id_t *fid) So they line up. regards, dan carpenter

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

2019-10-01 Thread Dan Carpenter
ot;); 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) { > + DBG_88E("Failed to allocate memory for HAL data\n"); Remove this debug printk. > + goto free_adapter; > + } regards, dan carpenter

Re: [PATCH] usb: typec: tcpm: Fix a signedness bug in tcpm_fw_get_caps()

2019-10-01 Thread Dan Carpenter
On Thu, Sep 26, 2019 at 05:53:10AM -0700, Guenter Roeck wrote: > On Wed, Sep 25, 2019 at 02:02:19PM +0300, Dan Carpenter wrote: > > The "port->typec_caps.data" and "port->typec_caps.type" variables are > > enums and in this context GCC will treat them

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

2019-10-01 Thread Dan Carpenter
or 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 ~/smatch/smatch_data/kernel.ignore_uninitialized_param file. regards, dan carpenter

Re: [PATCH] RDMA/iw_cgxb4: Fix an error handling path in 'c4iw_connect()'

2019-10-01 Thread Dan Carpenter
e the one goto and the error label. No need to re-number everything. You can audit a patch with properly named labels from directly within your email client instead of needing to re-review the whole function in the source. regards, dan carpenter

Re: [PATCH] mm, vmpressure: Fix a signedness bug in vmpressure_register_event()

2019-10-01 Thread Dan Carpenter
Sorry, for not replying. I got sick last week so I was out of office. Feeling better now. regards, dan carpenter

Re: [PATCH] get_maintainer: Add signatures from Fixes: lines in commit message

2019-10-01 Thread Dan Carpenter
Looks good! Thanks for this, Joe. regards, dan carpenter

Re: [PATCH] ASoC: amd: acp3x: clean up an indentation issue

2019-09-27 Thread Dan Carpenter
this fix before. ignore. apologies. Haha. I used to do this all the time. Now my QC script searches my outbox. I still send duplicates sometimes if I'm travelling and forget to copy my outbox over. regards, dan carpenter

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

2019-09-27 Thread Dan Carpenter
Looks good. Thanks! regards, dan carpenter

Re: [PATCH 5/5] ASoC: amd: ACP powergating should be done by controller

2019-09-26 Thread Dan Carpenter
essages. :/ > + ret = -ETIMEDOUT; return -ETIMOUT; > + break; > + } > + timeout++; > + } > + if (ret) { > + pr_err("ACP is not powered on status:%d\n&quo

Re: [PATCH] iio: imu: adis16480: clean up a condition

2019-09-26 Thread Dan Carpenter
On Thu, Sep 26, 2019 at 11:06:39AM +, Ardelean, Alexandru wrote: > On Thu, 2019-09-26 at 11:10 +0300, Dan Carpenter wrote: > > [External] > > > > The "t" variable is unsigned so it can't be less than zero. We really > > are just trying to prevent divide

[PATCH] ns2: Fix off by one bugs in ns2_pinmux_enable()

2019-09-26 Thread Dan Carpenter
ot;pinctrl: ns2: add pinmux driver support for Broadcom NS2 SoC") Signed-off-by: Dan Carpenter --- drivers/pinctrl/bcm/pinctrl-ns2-mux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/bcm/pinctrl-ns2-mux.c b/drivers/pinctrl/bcm/pinctrl-ns2-mux.c index 2

[PATCH] iio: imu: adis16480: clean up a condition

2019-09-26 Thread Dan Carpenter
The "t" variable is unsigned so it can't be less than zero. We really are just trying to prevent divide by zero bugs so just checking against zero is sufficient. Signed-off-by: Dan Carpenter --- drivers/iio/imu/adis16480.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH] HID: core: clean up indentation issue

2019-09-25 Thread Dan Carpenter
> the code for some more valid reason. Just use `git blame -w`. This probably came from a Smatch warning. Smatch warns very seldom warns about style issues, but in this case the indenting is legitimately bad. regards, dan carpenter

[PATCH] ASoC: topology: Fix a signedness bug in soc_tplg_dapm_widget_create()

2019-09-25 Thread Dan Carpenter
The "template.id" variable is an enum and in this context GCC will treat it as an unsigned int so it can never be less than zero. Fixes: 8a9782346dcc ("ASoC: topology: Add topology core") Signed-off-by: Dan Carpenter --- sound/soc/soc-topology.c | 2 +- 1 file change

[PATCH] mm, vmpressure: Fix a signedness bug in vmpressure_register_event()

2019-09-25 Thread Dan Carpenter
ressure.c: convert to use match_string() helper") Signed-off-by: Dan Carpenter --- mm/vmpressure.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/vmpressure.c b/mm/vmpressure.c index f3b50811497a..fe077500cf20 100644 --- a/mm/vmpressure.c +++ b/mm/vmpres

[PATCH] power: supply: sbs-battery: Fix a signedness bug in sbs_get_battery_capacity()

2019-09-25 Thread Dan Carpenter
The "mode" variable is an enum and in this context GCC treats it as an unsigned int so the error handling is never triggered. Fixes: 51d075660457 ("bq20z75: Add support for charge properties") Signed-off-by: Dan Carpenter --- drivers/power/supply/sbs-battery.c | 2 +

[PATCH] usb: typec: tcpm: Fix a signedness bug in tcpm_fw_get_caps()

2019-09-25 Thread Dan Carpenter
The "port->typec_caps.data" and "port->typec_caps.type" variables are enums and in this context GCC will treat them as an unsigned int so they can never be less than zero. Fixes: ae8a2ca8a221 ("usb: typec: Group all TCPCI/TCPM code together") Signed-off-by: D

[PATCH net] of: mdio: Fix a signedness bug in of_phy_get_and_connect()

2019-09-25 Thread Dan Carpenter
The "iface" variable is an enum and in this context GCC treats it as an unsigned int so the error handling is never triggered. Fixes: b78624125304 ("of_mdio: Abstract a general interface for phy connect") Signed-off-by: Dan Carpenter --- drivers/of/of_mdio.c | 2 +- 1 file

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

2019-09-24 Thread Dan Carpenter
to the original email and we apply the v1 patch that's the only thing to avoid. regards, dan carpenter

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

2019-09-24 Thread Dan Carpenter
step process, then this one is OK. It has to be done in one step. regards, dan carpenter

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

2019-09-24 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

[PATCH] rcu/nocb: Fix uninitialized variable in nocb_gp_wait()

2019-09-23 Thread Dan Carpenter
: Use rcu_segcblist for no-CBs CPUs") Signed-off-by: Dan Carpenter --- kernel/rcu/tree_plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 2defc7fe74c3..fa08d55f7040 100644 --- a/kernel/rcu/tree_plugin.h +++ b/

[PATCH] nvme: fix an error code in nvme_init_subsystem()

2019-09-23 Thread Dan Carpenter
"ret" should be a negative error code here, but it's either success or possibly uninitialized. Fixes: 32fd90c40768 ("nvme: change locking for the per-subsystem controller list") Signed-off-by: Dan Carpenter --- drivers/nvme/host/core.c | 5 +++-- 1 file changed, 3 insert

[PATCH] firmware: turris-mox-rwtm: small white space cleanup

2019-09-21 Thread Dan Carpenter
This patch deletes a stray tab. Signed-off-by: Dan Carpenter --- I don't use Fixes tags for whitespace but the commit that added this driver was commit 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver"). When we're adding a driver, it really helps if we use

[PATCH] md/raid0: Fix an error message in raid0_make_request()

2019-09-21 Thread Dan Carpenter
The first argument to WARN() is supposed to be a condition. The original code will just print the mdname() instead of the full warning message. Fixes: c84a1372df92 ("md/raid0: avoid RAID0 data corruption due to layout confusion.") Signed-off-by: Dan Carpenter --- drivers/md/raid0.c

Re: checkpatch warnings in sched.h

2019-09-20 Thread Dan Carpenter
for endian bugs until this gets fixed. It's been broken for a month so we'll probably get a flood of patches marking functions as static once we patch this and people start seeing that warning again. regards, dan carpenter

Re: [PATCH v3 1/2] memory: samsung: exynos5422-dmc: Fix kfree() of devm-allocated memory and missing static

2019-09-19 Thread Dan Carpenter
Thanks! Looks good. regards, dan carpenter

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

2019-09-18 Thread Dan Carpenter
functions and replaced them with NULL in function array. Thanks! regards, dan carpenter

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, I

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

2019-09-18 Thread Dan Carpenter
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 staging tree. regards, dan carpenter

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] media: v4l: cadence: Fix how unsued lanes are handled in 'csi2rx_start()'

2019-09-17 Thread Dan Carpenter
On Mon, Sep 16, 2019 at 09:24:26PM +0200, Christophe JAILLET wrote: > Le 16/09/2019 à 08:28, Dan Carpenter a écrit : > > On Fri, Sep 13, 2019 at 09:57:09AM +0200, Maxime Ripard wrote: > > > Hi Christophe, > > > > > > On Thu, Sep 12, 2019 at 10:44:

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

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

Re: [PATCH] iommu/qcom: Simplify a test in 'qcom_iommu_add_device()'

2019-09-17 Thread Dan Carpenter
On Mon, Sep 16, 2019 at 10:29:36PM +0200, Christophe JAILLET wrote: > 'iommu_group_get_for_dev()' never returns NULL, so this test can be > simplified a bit. > It used to until commit 72dcac633475 ("iommu: Warn once when device_group callback returns NULL"). Reviewed-by: Dan

Re: [Ksummit-discuss] [PATCH v2 3/3] libnvdimm, MAINTAINERS: Maintainer Entry Profile

2019-09-16 Thread Dan Carpenter
for networking, but it's kind of a pain in the butt and I mess up surpisingly often for how much effort I put into getting it right. regards, dan carpenter

Re: [PATCH] media: v4l: cadence: Fix how unsued lanes are handled in 'csi2rx_start()'

2019-09-16 Thread Dan Carpenter
but that still wouldn't tell us what the valid data is. It's hard to know the right answer from a static analysis point of view. regards, dan carpenter

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: [Ksummit-discuss] [PATCH v2 3/3] libnvdimm, MAINTAINERS: Maintainer Entry Profile

2019-09-13 Thread Dan Carpenter
On Fri, Sep 13, 2019 at 01:09:37AM -0600, Jonathan Corbet wrote: > On Wed, 11 Sep 2019 16:11:29 -0600 > Jens Axboe wrote: > > > On 9/11/19 12:43 PM, Dan Carpenter wrote: > > > > > > I kind of hate all this extra documentation because now everyone thinks > &

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

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

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

2019-09-11 Thread Dan Carpenter
ght 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

Re: [Ksummit-discuss] [PATCH v2 3/3] libnvdimm, MAINTAINERS: Maintainer Entry Profile

2019-09-11 Thread Dan Carpenter
ne who tries to tag their patches is going to do it badly anyway. regards, dan carpenter

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 carpenter

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 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 carpenter

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] 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 know it's safe. regards, dan carpenter

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

2019-09-11 Thread Dan Carpenter
the "name_buf" is a shared buffer. wow wow wow. This seems very racy. regards, dan carpenter

Re: [PATCH net 1/2] sctp: remove redundant assignment when call sctp_get_port_local

2019-09-11 Thread Dan Carpenter
On Wed, Sep 11, 2019 at 09:30:47AM +0800, maowenan wrote: > > > On 2019/9/11 3:22, Dan Carpenter wrote: > > On Tue, Sep 10, 2019 at 09:57:10PM +0300, Dan Carpenter wrote: > >> On Tue, Sep 10, 2019 at 03:13:42PM +0800, Mao Wenan wrote: > >>> There are mor

Re: [PATCH net 1/2] sctp: remove redundant assignment when call sctp_get_port_local

2019-09-10 Thread Dan Carpenter
On Tue, Sep 10, 2019 at 09:57:10PM +0300, Dan Carpenter wrote: > On Tue, Sep 10, 2019 at 03:13:42PM +0800, Mao Wenan wrote: > > There are more parentheses in if clause when call sctp_get_port_local > > in sctp_do_bind, and redundant assignment to 'ret'. This patch is to

Re: [PATCH net 1/2] sctp: remove redundant assignment when call sctp_get_port_local

2019-09-10 Thread Dan Carpenter
ch is either 0,1 or a pointer casted to long. It's not documented what it means and neither of the callers use the return since commit 62208f12451f ("net: sctp: simplify sctp_get_port"). Probably it should just return a bool? regards, dan carpenter

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 code you are talking about. :P regards, dan carpenter

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

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 original rtw_malloc() implementation is buggy nonsense). regards, dan carpenter

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

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

2019-09-10 Thread Dan Carpenter
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! ^^^ Don't put th

<    5   6   7   8   9   10   11   12   13   14   >