Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-24 Thread Gustavo A. R. Silva
On Mon, Nov 23, 2020 at 08:38:46PM +, Mark Brown wrote: > On Fri, 20 Nov 2020 12:21:39 -0600, Gustavo A. R. Silva wrote: > > This series aims to fix almost all remaining fall-through warnings in > > order to enable -Wimplicit-fallthrough for Clang. > > > > In prepa

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-12-01 Thread Gustavo A. R. Silva
On Tue, Dec 01, 2020 at 12:52:27AM -0500, Martin K. Petersen wrote: > > Gustavo, > > > This series aims to fix almost all remaining fall-through warnings in > > order to enable -Wimplicit-fallthrough for Clang. > > Applied 20-22,54,120-124 to 5.11/scsi-staging, thanks. Awesome! :) Thanks, Mart

[PATCH] staging: wilc1000: fix memory leak in wilc_add_rx_gtk

2018-12-22 Thread Gustavo A. R. Silva
In case *mode* happens to be different than WILC_AP_MODE and WILC_STATION_MODE, gtk_key is not released, hence leanding to a memory leak. So, in this case it is safer to release gtk_key just before returning to callers. Addresses-Coverity-ID: 1476020 ("Resource leak") Signed-off-by: Gu

[PATCH] staging: mt7621-dma: Use struct_size() in devm_kzalloc()

2019-01-04 Thread Gustavo A. R. Silva
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct foo { int stuff; void *entry[]; }; instance = devm_kzalloc(dev, sizeof

[PATCH] staging: rtl8188eu: Replace kzalloc with kcalloc

2019-01-14 Thread Gustavo A. R. Silva
Replace kzalloc() function with its 2-factor argument form, kcalloc(). This patch replaces cases of: kzalloc(a * b, gfp) with: kcalloc(a, b, gfp) This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/rtl8188eu/core

[PATCH] staging: comedi: ni_660x: fix missing break in switch statement

2019-02-12 Thread Gustavo A. R. Silva
;) Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/staging/comedi/drivers/ni_660x.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index e70a461e723f..405573e927cf 100644 --- a/drivers/staging/come

[PATCH v2] staging: comedi: ni_660x: fix missing break in switch statement

2019-02-12 Thread Gustavo A. R. Silva
uting()") Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Fix Fixes tag. drivers/staging/comedi/drivers/ni_660x.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index e7

Re: [PATCH] staging: comedi: ni_660x: fix missing break in switch statement

2019-02-12 Thread Gustavo A. R. Silva
Hi, Please, drop this. I've just sent v2 with the right Fixes tag: https://lore.kernel.org/patchwork/patch/1041301/ Thanks -- Gustavo On 2/12/19 12:08 PM, Gustavo A. R. Silva wrote: > Add missing break statement in order to prevent the code from falling > through to the defau

Re: [PATCH v2] staging: comedi: ni_660x: fix missing break in switch statement

2019-02-13 Thread Gustavo A. R. Silva
On 2/13/19 4:41 AM, Ian Abbott wrote: > On 12/02/2019 18:44, Gustavo A. R. Silva wrote: >> Add missing break statement in order to prevent the code from falling >> through to the default case and return -EINVAL every time. >> >> This bug was found thanks to th

[PATCH] staging: vt6656: key: Mark expected switch fall-throughs

2019-02-18 Thread Gustavo A. R. Silva
vel 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/vt6656/key.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/key.c b/driv

Re: [PATCH] staging: comedi: ni_660x: fix missing break in switch statement

2019-02-18 Thread Gustavo A. R. Silva
Hi Sasha, On 2/18/19 3:14 PM, Sasha Levin wrote: > Hi, > > [This is an automated email] > > This commit has been processed because it contains a "Fixes:" tag, > fixing commit: 58dd7c0a2a6e Staging: comedi: add ni_660x driver. > > The bot has tested the

[PATCH] staging: ralink-gdma: Use struct_size() in kzalloc()

2019-04-03 Thread Gustavo A. R. Silva
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct foo { int stuff; struct boo entry[]; }; size = sizeof(struct foo

[PATCH] staging: greybus: power_supply: Use struct_size() helper

2019-04-03 Thread Gustavo A. R. Silva
) with: struct_size(resp, props, props_count) This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/greybus/power_supply.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/power_supply.c b/drivers

[PATCH 2/2] Staging: comedi: kcomedilib: Fixed a typo

2015-01-11 Thread Gustavo A. R. Silva
Fixed a typo in kcomedilib_main.c file. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/comedi/kcomedilib/kcomedilib_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c b/drivers/staging/comedi/kcomedilib

[PATCH 3/3] Staging: nvec: Fixed a typo

2015-01-11 Thread Gustavo A. R. Silva
Fixed a typo in nvec.c file Signed-off-by: Gustavo A. R. Silva --- drivers/staging/nvec/nvec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 093535c..2637059 100644 --- a/drivers/staging/nvec/nvec.c +++ b

[PATCH 4/4] Staging: octeon-usb: Fixed a typo

2015-01-11 Thread Gustavo A. R. Silva
Fixed a typo in octeon-hcd.c file Signed-off-by: Gustavo A. R. Silva --- drivers/staging/octeon-usb/octeon-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c index 6b8b108..1daeb31 100644

[PATCH] Staging: octeon: Fixed a typo

2015-01-11 Thread Gustavo A. R. Silva
Fixed a typo in ethernet.c file. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/octeon/ethernet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c index ee32149..460e854 100644 --- a/drivers

[PATCH] Staging: comedi: kcomedilib: Fixed a typo

2015-01-11 Thread Gustavo A. R. Silva
Fixed a typo in kcomedilib_main.c file. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/comedi/kcomedilib/kcomedilib_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c b/drivers/staging/comedi/kcomedilib

[PATCH] Staging: nvec: Fixed a typo

2015-01-11 Thread Gustavo A. R. Silva
Fixed a typo in nvec.c file Signed-off-by: Gustavo A. R. Silva --- drivers/staging/nvec/nvec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 093535c..2637059 100644 --- a/drivers/staging/nvec/nvec.c +++ b

[PATCH] Staging: octeon-usb: Fixed a typo

2015-01-11 Thread Gustavo A. R. Silva
Fixed a typo in octeon-hcd.c file Signed-off-by: Gustavo A. R. Silva --- drivers/staging/octeon-usb/octeon-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c index 6b8b108..1daeb31 100644

[PATCH] Staging: olpc_dcon: Fixed a typo

2015-01-11 Thread Gustavo A. R. Silva
Fixed a typo in olpc_dcon_xo_1.c file. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/olpc_dcon/olpc_dcon_xo_1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c b/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c index 77e8eb5

[PATCH] Staging: vt6655: Fixed a typo

2015-01-11 Thread Gustavo A. R. Silva
Fixed a typo in mac.c file. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/vt6655/mac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c index 8f0d652..1975c91 100644 --- a/drivers/staging/vt6655/mac.c

[PATCH] Staging: vt6656: Fixed typo in a macro name

2015-01-11 Thread Gustavo A. R. Silva
Fixed typo in a macro name in card.c and device.h files. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/vt6656/card.c | 2 +- drivers/staging/vt6656/device.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656

[PATCH] Staging: vt6656: Fixed typo in a variable name

2015-01-11 Thread Gustavo A. R. Silva
Fixed typo in a variable name in dpc.h file. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/vt6656/dpc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/dpc.h b/drivers/staging/vt6656/dpc.h index fab195f..95e0e83 100644 --- a/drivers/staging

Re: [PATCH] staging: greybus: power_supply: Use struct_size() helper

2019-04-10 Thread Gustavo A. R. Silva
Hi Johan, On 4/4/19 1:57 AM, Johan Hovold wrote: > > This patch looks good, but I noticed a bug here in the current code, > which should be fixed before applying this clean up. > > sizeof(req) should have been sizeof(*req) above. > Good catch. >> -

Re: [PATCH] staging: greybus: power_supply: Use struct_size() helper

2019-04-10 Thread Gustavo A. R. Silva
Johan, On 4/4/19 2:24 AM, Johan Hovold wrote: > On Thu, Apr 04, 2019 at 08:09:51AM +0100, Rui Miguel Silva wrote: >> Hi Gustavo, >> Thanks a lot for the patch. >> >> On Wed 03 Apr 2019 at 21:58, Gustavo A. R. Silva wrote: >>> Make use of the struct_si

[PATCH v2] staging: greybus: power_supply: use struct_size() helper

2019-04-17 Thread Gustavo A. R. Silva
) with: struct_size(resp, props, props_count) This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Rebase on top of 47830c1127ef ("staging: greybus: power_supply: fix prop-descriptor request size") drivers/staging/greybus/power_su

Re: [PATCH v2] staging: greybus: power_supply: use struct_size() helper

2019-04-18 Thread Gustavo A. R. Silva
On 4/18/19 1:27 AM, Johan Hovold wrote: > On Wed, Apr 17, 2019 at 01:44:40PM -0500, Gustavo A. R. Silva wrote: >> Make use of the struct_size() helper instead of an open-coded version >> in order to avoid any potential type mistakes, in particular in the >> context in whi

[PATCH] staging: most: core: replace strcpy() by strscpy()

2019-04-22 Thread Gustavo A. R. Silva
0 ("Copy into fixed size buffer") Fixes: 131ac62253db ("staging: most: core: use device description as name") Signed-off-by: Gustavo A. R. Silva --- drivers/staging/most/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/most/cor

Re: [PATCH] staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro

2019-04-25 Thread Gustavo A. R. Silva
< c) > +BIT(c) > > Signed-off-by: Vatsala Narang > --- > drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c > b/drivers/staging/rtl81

Re: [PATCH v2 2/2] staging: rtl8192u: ieee80211: Fix spelling mistake

2019-04-26 Thread Gustavo A. R. Silva
Hi Vatsala, On 4/26/19 3:43 AM, Vatsala Narang wrote: > Replace explicitely with explicitly to get rid of checkpatch warning. > > Signed-off-by: Vatsala Narang > --- > Changes in v2: > -added this patch to patchset to fix spelling mistake. > When you create a series,

[PATCH] staging: rtlwifi: mark expected switch fall-through in rtl_make_smps_action

2017-10-10 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/rtlwifi/base.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/rtlwifi/base.c b/drivers

[PATCH] staging: typec: tcpci: mark expected switch fall-through in tcpci_to_typec_cc

2017-10-10 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/typec/tcpci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c

[PATCH] staging: vt6655: mark expected switch fall-throughs in vnt_set_keymode

2017-10-10 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/vt6655/key.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/vt6655/key.c b/drivers/staging

[PATCH 13/20] staging: rtlwifi: halmac: mark expected switch fall-through

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/rtlwifi/halmac/rtl_halmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtlwifi/halmac

[PATCH 15/20] staging: lustre: llite: mark expected switch fall-through

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/lustre/lustre/llite/namei.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre

[PATCH 17/20] staging: lustre: ldlm: mark expected switch fall-through

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/lustre/lustre/ldlm

[PATCH 11/20] staging: r8822be: mark expected switch fall-throughs

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_api_88xx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/rtlwifi/halmac

[PATCH 09/20] staging: vt6656: card: mark expected switch fall-throughs

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/vt6656/card.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c

[PATCH 07/20] staging: rtl8188eu: usb_halinit: mark expected switch fall-through

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1373894 Signed-off-by: Gustavo A. R. Silva --- drivers/staging/rtl8188eu/hal/usb_halinit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging

[PATCH 02/20] staging: lustre: lnet: socklnd: mark expected switch fall-through

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lnet

[PATCH 14/20] staging: lustre: lnet: selftest: mark expected switch fall-throughs

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/lustre/lnet/selftest/module.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lnet

[PATCH 20/20] staging: lustre: rpc: mark expected switch fall-throughs

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1077604 Addresses-Coverity-ID: 1077605 Signed-off-by: Gustavo A. R. Silva --- drivers/staging/lustre/lnet/selftest/rpc.c | 13 + 1 file changed, 9

[PATCH 16/20] staging: lustre: lprocfs: mark expected switch fall-throughs

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1271166 Addresses-Coverity-ID: 1271167 Addresses-Coverity-ID: 1271168 Addresses-Coverity-ID: 1271169 Signed-off-by: Gustavo A. R. Silva --- drivers/staging/lustre

[PATCH 12/20] staging: lustre: lnet: selftest: mark expected switch fall-through

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/lustre/lnet/selftest/conctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b

[PATCH 01/20] staging: ks7010: ks_wlan_net: mark expected switch fall-throughs

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1364489 Signed-off-by: Gustavo A. R. Silva --- drivers/staging/ks7010/ks_wlan_net.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging

[PATCH 05/20] staging: lustre: lnet: net_fault: mark expected switch fall-through

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/lustre/lnet/lnet/net_fault.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/lustre/lnet/lnet/net_fault.c b

[PATCH 00/20] mark expected switch fall-throughs

2017-10-12 Thread Gustavo A. R. Silva
yzers have solved it. It does both document the intention for humans and provide a way for analyzers to report issues. Having the compiler help us not make mistakes is quite handy." In some cases there were "no break" or "fall thru" comments already in place. So I replaced

[PATCH 08/20] staging: vc04_services: vchiq_core: mark expected switch fall-through

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers

[PATCH 03/20] staging: rtl8192e: mark expected switch fall-through

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/rtl8192e/rtllib_wx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b

[PATCH 18/20] staging: lustre: osc: mark expected switch fall-through

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1077598 Signed-off-by: Gustavo A. R. Silva --- drivers/staging/lustre/lustre/osc/osc_cache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging

[PATCH 06/20] staging: comedi: s526: mark expected switch fall-through

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/comedi/drivers/s526.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/s526

[PATCH 04/20] staging: rtl8723bs: rtw_mlme_ext: mark expected switch fall-through

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/core

[PATCH 10/20] staging: rtl8188eu: usb_ops_linux: mark expected switch fall-through

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1077613 Signed-off-by: Gustavo A. R. Silva --- drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging

[PATCH 19/20] staging: lustre: ptlrpc: mark expected switch fall-throughs

2017-10-12 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/lustre/lustre/ptlrpc/pack_generic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging

[PATCH] staging: wlan-ng: Remove unnecessary parentheses

2017-10-16 Thread Frank A. Cancio Bello
checkpatch message: 'CHECK: Unnecessary parentheses around'. Signed-off-by: Frank A. Cancio Bello --- FYI: * I read 'Ignore checkpatch.pl if it complains about parens around boolean expressions or ternary conditionals in return values, like this: return ((depth &g

Re: [Outreachy kernel] [PATCH] staging: wlan-ng: Remove unnecessary parentheses

2017-10-16 Thread Frank A. Cancio Bello
On Mon, Oct 16, 2017 at 10:18:14PM +0200, Julia Lawall wrote: > This patch has the same subject line as the one I previously commented on > (modulo the typo in that one). > Thanks Julia for your quick response. Before work on your suggestions I have a question regarding the above com

[PATCH v2] staging: wlan-ng: Remove unnecessary parentheses

2017-10-16 Thread Frank A. Cancio Bello
Remove unnecessary parentheses to comply with preferred coding style for the linux kernel and avoid the following checkpatch's message: 'CHECK: Unnecessary parentheses around' Credits to checkpatch. Signed-off-by: Frank A. Cancio Bello --- Changes in v2: * I rewrote the

[PATCH] staging: media: imx: fix inconsistent IS_ERR and PTR_ERR

2017-10-17 Thread Gustavo A. R. Silva
Fix inconsistent IS_ERR and PTR_ERR in csi_link_validate. The proper pointer to be passed as argument is sensor. This issue was detected with the help of Coccinelle. Reported-by: Julia Lawall Signed-off-by: Gustavo A. R. Silva --- This code was tested by compilation only. drivers/staging

Re: [PATCH v2] staging: wlan-ng: Remove unnecessary parentheses

2017-10-18 Thread Frank A. Cancio Bello
On Wed, Oct 18, 2017 at 04:17:04PM +0200, Greg KH wrote: > On Mon, Oct 16, 2017 at 09:48:21PM -0400, Frank A. Cancio Bello wrote: > > Remove unnecessary parentheses to comply with preferred coding style for > > the linux kernel and avoid the following checkpatch's message: >

[PATCH v3] staging: wlan-ng: Remove unnecessary parentheses

2017-10-18 Thread Frank A. Cancio Bello
Remove unnecessary parentheses to comply with preferred coding style for the linux kernel and avoid the following checkpatch's messages: 'CHECK: Unnecessary parentheses around' 'CHECK: Logical continuations should be on the previous line' Credits to checkpatch. Signe

Re: [PATCH v3] staging: wlan-ng: Remove unnecessary parentheses

2017-10-18 Thread Frank A. Cancio Bello
On Thu, Oct 19, 2017 at 08:40:08AM +1100, Tobin C. Harding wrote: > On Wed, Oct 18, 2017 at 11:48:21AM -0400, Frank A. Cancio Bello wrote: > > --- a/drivers/staging/wlan-ng/p80211req.c > > +++ b/drivers/staging/wlan-ng/p80211req.c > > @@ -124,7 +124,7 @@ int p80211req_dorequ

Re: [PATCH 00/20] mark expected switch fall-throughs

2017-10-23 Thread Gustavo A. R. Silva
Quoting "Gustavo A. R. Silva" : In preparation to enabling -Wimplicit-fallthrough, this patchset aims to mark switch cases where we are expecting to fall through. In Kees Cook words: "This is an unfortunate omission in the C language, and thankfully both gcc and clang have step

[PATCH] staging: speakup: selection: replace _manual_ swap with swap macro

2017-11-10 Thread Gustavo A. R. Silva
Make use of the swap macro instead of _manually_ swapping values and remove unnecessary variable tmp. This makes the code easier to read and maintain. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/speakup/selection.c | 9

[PATCH] Drivers: hv: hv_kvp: Mark expected switch fall-through

2018-07-02 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/hv/hv_kvp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c index 5eed1e7..9b1adcb 100644

[PATCH] staging: speakup: fix warning for static declaration

2017-03-27 Thread Gustavo A. R. Silva
Fix the following sparse warning: symbol 'spk_serial_out' was not declared. Should it be static? Signed-off-by: Gustavo A. R. Silva --- drivers/staging/speakup/serialio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/speakup/serialio.c b/drive

[PATCH] staging: ks7010_sdio: fix NULL pointer dereference and memory leak

2018-04-12 Thread Gustavo A. R. Silva
priv is being dereferenced when it is still null, hence there is an explicit null pointer dereference at line 935: free_netdev(priv->net_dev) Also, memory allocated for netdev at line 854: netdev = alloc_etherdev(sizeof(*priv)); is not being free'd, hence there is a memory leak. Fix this

[PATCH v2] staging: ks7010_sdio: fix memory leak

2018-04-12 Thread Gustavo A. R. Silva
Memory allocated for netdev at line 854: netdev = alloc_etherdev(sizeof(*priv)); is not being free'd before return, hence there is a memory leak. Fix this by freeing netdev before return. Addresses-Coverity-ID: 1467844 Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Update subjec

Re: [PATCH] staging: ks7010_sdio: fix NULL pointer dereference and memory leak

2018-04-12 Thread Gustavo A. R. Silva
Hi Dan, On 04/12/2018 10:08 AM, Dan Carpenter wrote: I added Colin to the Cc list. On Thu, Apr 12, 2018 at 09:30:09AM -0500, Gustavo A. R. Silva wrote: priv is being dereferenced when it is still null, hence there is an explicit null pointer dereference at line 935: free_netdev(priv->net_

[PATCH v3] staging: ks7010_sdio: fix NULL pointer dereference and memory leak

2018-04-12 Thread Gustavo A. R. Silva
priv is being explicitly dereferenced when it is still null, when jumping to goto label err_free_netdev, before it is properly updated with a valid memory address. Also, when this happens, memory allocated for netdev at line 854: netdev = alloc_etherdev(sizeof(*priv)) is not being free'd b

[PATCH] staging: media: davinci_vpfe: fix spin_lock/unlock imbalance

2018-04-18 Thread Gustavo A. R. Silva
It seems that this is a copy-paste error and that the proper variable to use in this particular case is video_out2 instead of video_out. Addresses-Coverity-ID: 1467961 ("Copy-paste error") Fixes: 45e46b3bbe18 ("[media] davinci: vpfe: dm365: resizer driver based on media framework&

[PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-04-30 Thread Gustavo A. R. Silva
wilc1000: refactor scan() to free kmalloc memory on failure cases") Signed-off-by: Gustavo A. R. Silva --- BTW... at first sight it seems to me that variables slot_id and i should be of type unsigned instead of signed. drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- 1 file cha

[PATCH] staging: greybus: Replace zero-length array with flexible-array member

2020-02-11 Thread Gustavo A. R. Silva
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By

[PATCH] staging: unisys: visorinput: Replace zero-length array with flexible-array member

2020-02-11 Thread Gustavo A. R. Silva
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By

Re: [greybus-dev] [PATCH] staging: greybus: Replace zero-length array with flexible-array member

2020-02-11 Thread Gustavo A. R. Silva
On 2/11/20 16:15, Alex Elder wrote: > On 2/11/20 3:12 PM, Gustavo A. R. Silva wrote: >> The current codebase makes use of the zero-length array language >> extension to the C90 standard, but the preferred mechanism to declare >> variable-length types such as these one

[PATCH] staging: Replace zero-length array with flexible-array member

2020-02-20 Thread Gustavo A. R. Silva
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By

Re: [PATCH] staging: Replace zero-length array with flexible-array member

2020-02-20 Thread Gustavo A. R. Silva
Hi, On 2/20/20 13:04, adham.aboza...@microchip.com wrote: > Hi Gustavo > > On 2/20/20 6:29 AM, Gustavo A. R. Silva wrote: >> The current codebase makes use of the zero-length array language >> extension to the C90 standard, but the preferred mechanism to declare >> va

Re: [PATCH] staging: qlge: add braces on all arms of if-else

2020-02-21 Thread Gustavo A. R. Silva
On 2/21/20 14:29, Kaaira Gupta wrote: > fix all checkpatch.pl warnings of 'braces {} should be used on all arms > of this statement' in the file qlge_ethtool.c by adding the braces. > > Signed-off-by: Kaaira Gupta Acked-by: Gustavo A. R. Silva Thanks for

[PATCH] Staging:bcm: Fixes coding style issues in drivers/staging/bcm/Qos.c

2014-03-25 Thread Marcos A. Di Pietro
Fixes code style errors in drivers/staging/bcm/Qos.c Patch submitted as part of the Eudyptula Challenge. Signed-off-by: Marcos A. Di Pietro --- drivers/staging/bcm/Qos.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/staging/bcm/Qos.c b/drivers

Re: [PATCH] Staging:bcm: Fixes coding style issues in drivers/staging/bcm/Qos.c

2014-04-10 Thread Marcos A. Di Pietro
On 04/10/2014 04:14 PM, Greg KH wrote: > On Tue, Mar 25, 2014 at 01:55:47PM -0400, Marcos A. Di Pietro wrote: >> Fixes code style errors in drivers/staging/bcm/Qos.c >> >> Patch submitted as part of the Eudyptula Challenge. >> >> Signed-off-by: Marcos A. Di Pietr

Re: [PATCH] Staging:bcm: Fixes coding style issues in drivers/staging/bcm/Qos.c

2014-04-10 Thread Marcos A. Di Pietro
On 04/10/2014 04:55 PM, Greg KH wrote: > On Thu, Apr 10, 2014 at 04:22:13PM -0400, Marcos A. Di Pietro wrote: >> On 04/10/2014 04:14 PM, Greg KH wrote: >>> On Tue, Mar 25, 2014 at 01:55:47PM -0400, Marcos A. Di Pietro wrote: >>>> Fixes code style errors in drivers/sta

Re: [PATCH] Staging:bcm: Fixes coding style issues in drivers/staging/bcm/Qos.c

2014-04-10 Thread Marcos A. Di Pietro
On 04/10/2014 07:27 PM, Greg KH wrote: > On Thu, Apr 10, 2014 at 06:56:01PM -0400, Marcos A. Di Pietro wrote: >> On 04/10/2014 04:55 PM, Greg KH wrote: >>> On Thu, Apr 10, 2014 at 04:22:13PM -0400, Marcos A. Di Pietro wrote: >>>> On 04/10/2014 04:14 PM, Greg KH wrote:

Re: [PATCH] Staging:bcm: Fixes coding style issues in drivers/staging/bcm/Qos.c

2014-04-10 Thread Marcos A. Di Pietro
On 04/10/2014 07:56 PM, Greg KH wrote: > On Thu, Apr 10, 2014 at 07:27:27PM -0400, Marcos A. Di Pietro wrote: >>> That's pretty obviously not going to apply properly, you have line-wrapp >>> on. You can't cut-and-paste patches into gmail, see >>> Doc

Re: [PATCH] Staging:bcm: Fixes coding style issues in drivers/staging/bcm/Qos.c

2014-04-10 Thread Marcos A. Di Pietro
On 04/10/2014 07:27 PM, Greg KH wrote: > On Thu, Apr 10, 2014 at 06:56:01PM -0400, Marcos A. Di Pietro wrote: >> On 04/10/2014 04:55 PM, Greg KH wrote: >>> On Thu, Apr 10, 2014 at 04:22:13PM -0400, Marcos A. Di Pietro wrote: >>>> On 04/10/2014 04:14 PM, Greg KH wrote:

[PATCH v2] Staging:bcm: Fixes coding style issues in drivers/staging/bcm/Qos.c

2014-04-11 Thread Marcos A. Di Pietro
Fixes code style errors in drivers/staging/bcm/Qos.c Patch submitted as part of the Eudyptula Challenge Signed-off-by: Marcos A. Di Pietro --- drivers/staging/bcm/Qos.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/bcm/Qos.c b/drivers/staging/bcm

Re: [PATCH] Staging:bcm: Fixes coding style issues in drivers/staging/bcm/Qos.c

2014-04-15 Thread Marcos A. Di Pietro
On 04/10/2014 07:56 PM, Greg KH wrote: > On Thu, Apr 10, 2014 at 07:27:27PM -0400, Marcos A. Di Pietro wrote: >>> That's pretty obviously not going to apply properly, you have line-wrapp >>> on. You can't cut-and-paste patches into gmail, see >>> Doc

Re: [PATCH] Staging:bcm: Fixes coding style issues in drivers/staging/bcm/Qos.c

2014-04-16 Thread Marcos A. Di Pietro
On 04/16/2014 02:25 PM, Greg KH wrote: > On Wed, Apr 16, 2014 at 02:18:46PM -0400, Marcos Di Pietro wrote: >> On Wed, Apr 16, 2014 at 11:39 AM, Greg KH wrote: >>> On Tue, Apr 15, 2014 at 09:37:18PM -0400, Marcos A. Di Pietro wrote: >>>> On 04/10/2014 07:56 PM, Greg

[PATCH v3] Staging:bcm: Fixes coding style issues in drivers/staging/bcm/Qos.c

2014-04-17 Thread Marcos A. Di Pietro
Fixes code style errors in drivers/staging/bcm/Qos.c Signed-off-by: Marcos A. Di Pietro --- drivers/staging/bcm/Qos.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/staging/bcm/Qos.c b/drivers/staging/bcm/Qos.c index 4f31583..1f5edef 100644 --- a

[PATCH] staging: lustre: ptlrpc: remove unnecessary code

2017-05-10 Thread Gustavo A. R. Silva
offset is an unsigned variable and, greater-than-or-equal-to-zero comparison of an unsigned variable is always true. Addresses-Coverity-ID: 1373919 Signed-off-by: Gustavo A. R. Silva --- drivers/staging/lustre/lustre/ptlrpc/layout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH] Staging: lustre: lustre: lmv: Compress return logic into one line.

2017-01-04 Thread Gustavo A. R. Silva
Simplify return logic to avoid unnecessary variable assignments. These issues were detected using Coccinelle and the following semantic patch: @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: Gustavo A. R. Silva --- drivers/staging/lustre/lustre

[PATCH] Staging: fbtft: Fix too many leading tabs warning

2016-10-11 Thread Gustavo A. R. Silva
This is a patch to the fb_agm1264k-fl.c file that fixes up the following issue: WARNING: Too many leading tabs - consider code refactoring Add new function iterate_diffusion_matrix() to refactor a piece of code inside write_vmem(). Signed-off-by: Gustavo A. R. Silva --- drivers/staging/fbtft

[PATCH 1/2] staging: ccree: remove unnecessary cast on kmalloc

2017-07-08 Thread Gustavo A. R. Silva
The assignment operator implicitly converts a void pointer to the type of the pointer it is assigned to. This issue was detected using Coccinelle and the following semantic patch: @@ expression * e; expression arg1, arg2; type T; @@ - e=(T*) + e= kmalloc(arg1, arg2); Signed-off-by: Gustavo A

[PATCH 2/2] staging: ccree: use sizeof(*var) in kmalloc

2017-07-08 Thread Gustavo A. R. Silva
Fix the following checkpatch warning: CHECK: Prefer kmalloc(sizeof(*buff_mgr_handle)...) over kmalloc(sizeof(struct buff_mgr_handle)...) Signed-off-by: Gustavo A. R. Silva --- drivers/staging/ccree/ssi_buffer_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH] staging: bcm2835-audio: constify snd_pcm_ops structures

2017-07-20 Thread Gustavo A. R. Silva
Check for snd_pcm_ops structures that are only stored in the ops field of a snd_soc_platform_driver structure or passed as the third argument to snd_pcm_set_ops. The corresponding field or parameter is declared const, so snd_pcm_ops structures that have this property can be declared as const also

[PATCH] staging: most: hdm-dim2: fix error return code in dim2_probe()

2017-08-08 Thread Gustavo A. R. Silva
/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af Print and propagate the return value of platform_get_irq on failure. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/most/hdm-dim2/dim2_hdm.c | 8 1

[PATCH] staging: iio: adc: fix error return code in ad7606_par_probe()

2017-08-09 Thread Gustavo A. R. Silva
Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/iio/adc/ad7606_par.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/adc/ad7606_par.c b/drivers/staging/iio/adc/ad7606_par.c index cd6c410c..3eb6f8f 100644 --- a/drivers/staging/iio

[PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-09 Thread Marcos A. Di Pietro
Fixes warning static analysis warning raised by sparse in drivers/staging/comedi/drivers/ni_stc.h warning: shift too big (4294967295) for type int Signed-off-by: Marcos A. Di Pietro --- drivers/staging/comedi/drivers/ni_stc.h | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff

[RFC] [HELP] [WMI] Media keys on MSI GE60 (patching msi_wmi for it)

2014-07-04 Thread Vadim A. Misbakh-Soloviov
me key many times, eventcode value will be changed after 4s, but it will not change if I press another mediakeys. Can anybody advice me, why can I experience such behaviour? And is it a way to get mediakeys working without patching DSDT (last time I did that I brake my bluetooth module in th

[PATCH] android: binder: Use true and false for boolean values

2018-01-23 Thread Gustavo A. R. Silva
Assign true or false to boolean variables instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/android/binder.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/android/binder.c b

[PATCH] staging: imx-media-vdic: fix inconsistent IS_ERR and PTR_ERR

2018-01-23 Thread Gustavo A. R. Silva
Fix inconsistent IS_ERR and PTR_ERR in vdic_get_ipu_resources. The proper pointer to be passed as argument is ch. This issue was detected with the help of Coccinelle. Fixes: 0b2e9e7947e7 ("media: staging/imx: remove confusing IS_ERR_OR_NULL usage") Signed-off-by: Gustavo A

<    1   2   3   4   5   >