[PATCH] usb: udc: lpc32xx: silence fall-through warning

2019-08-20 Thread Gustavo A. R. Silva
Silence the following fall-through warning by adding a break statement: drivers/usb/gadget/udc/lpc32xx_udc.c:2230:3: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/udc/lpc32xx_udc.c | 2 +- 1 file changed, 1

[PATCH] USB: gadget: udc: s3c2410_udc: Mark expected switch fall-throughs

2019-08-05 Thread Gustavo A. R. Silva
: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/udc/s3c2410_udc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c index af3e63316ace

[PATCH] usb: gadget: atmel_usba_udc: Mark expected switch fall-through

2019-08-05 Thread Gustavo A. R. Silva
Mark switch cases where we are expecting to fall through. This patch fixes the following warning (Building: at91_dt_defconfig arm): drivers/usb/gadget/udc/atmel_usba_udc.c:329:13: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Gustavo A. R. Silva

[PATCH] usb: host: ohci-tmio: Mark expected switch fall-throughs

2019-07-29 Thread Gustavo A. R. Silva
st/ohci-tmio.c:103:7: warning: this statement may fall through [-Wimplicit-fallthrough=] pm |= CCR_PM_USBPW2; ^ drivers/usb/host/ohci-tmio.c:104:3: note: here case 1: ^~~~ Signed-off-by: Gustavo A. R. Silva --- drivers/usb/host/ohci-tmio.c | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH] usb: phy: ab8500-usb: Mark expected switch fall-throughs

2019-07-28 Thread Gustavo A. R. Silva
05: ^~~~ Reported-by: Stephen Rothwell Signed-off-by: Gustavo A. R. Silva --- drivers/usb/phy/phy-ab8500-usb.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c index aaf363f19714..14b432982fd3 100644 --- a/driver

Re: [PATCH] USB: serial: io_edgeport: fix up switch fall-through comments

2019-05-03 Thread Gustavo A. R. Silva
lthrough. As part of that, the io_edgeport.c driver is a >> bit "messy" with the parsing logic of a data packet. Clean that logic >> up a bit by unindenting one level of the logic, and properly label >> /* Fall through */ to make gcc happy. >> >> Reported-by: Gust

Re: [PATCH] USB: serial: io_edgeport: fix up switch fall-through comments

2019-05-02 Thread Gustavo A. R. Silva
with the parsing logic of a data packet. Clean that logic > up a bit by unindenting one level of the logic, and properly label > /* Fall through */ to make gcc happy. > > Reported-by: Gustavo A. R. Silva > Signed-off-by: Greg Kroah-Hartman > Acked-by: Gustavo A. R. Silva Th

[PATCH] usb: wusbcore: wa-xfer: use struct_size() helper

2019-02-18 Thread Gustavo A. R. Silva
_count) to : struct_size(packet_status, PacketStatus, seg->isoc_frame_count); This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/usb/wusbcore/wa-xfer.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dr

[PATCH] usb: core: config: Use struct_size() in kzalloc()

2019-02-18 Thread Gustavo A. R. Silva
necessary, hence it is removed. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/usb/core/config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 7bb6b1bd06c8

[PATCH] usb: dwc2: use struct_size() in kzalloc()

2019-02-18 Thread Gustavo A. R. Silva
necessary, hence it is removed. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/usb/dwc2/hcd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index dd82fa516f3f..3f087962f498

Re: [PATCH] USB: musb: mark expected switch fall-through

2019-02-13 Thread Gustavo A. R. Silva
On 2/13/19 3:08 AM, Greg Kroah-Hartman wrote: > On Tue, Feb 12, 2019 at 01:47:54PM -0600, Bin Liu wrote: >> Hi Greg, >> >> On Tue, Feb 12, 2019 at 01:23:57PM -0600, Gustavo A. R. Silva wrote: >>> In preparation to enabling -Wimplicit-fallthrough, mark switch >&

[PATCH] USB: musb: mark expected switch fall-through

2019-02-12 Thread Gustavo A. R. Silva
is expecting to find. This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/usb/musb/musb_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c in

[PATCH net-next] net: usb: pegasus: Mark expected switch fall-through

2019-02-08 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/net/usb

[PATCH net-next] net: usb: rtl8150: mark expected switch fall-through

2019-02-08 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/net/usb

[PATCH net-next] net: usb: cdc-phonet: use struct_size() in alloc_netdev()

2019-02-07 Thread Gustavo A. R. Silva
) + count * sizeof(void *)); Instead of leaving these open-coded and prone to type mistakes, we can now use the new struct_size() helper: instance = alloc(struct_size(instance, entry, count)); This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/net

[PATCH] usb: gadget: udc: net2272: Fix bitwise and boolean operations

2019-01-22 Thread Gustavo A. R. Silva
ne can double-check this. This issue was detected with the help of Coccinelle. Fixes: ceb80363b2ec ("USB: net2272: driver for PLX NET2272 USB device controller") Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/udc/net2272.c | 2 +- 1 file changed, 1

[PATCH] uwb: use struct_size() in kzalloc()

2019-01-08 Thread Gustavo A. R. Silva
foo) + sizeof(void *) * count, GFP_KERNEL); Instead of leaving these open-coded and prone to type mistakes, we can now use the new struct_size() helper: instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL); This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A

[PATCH] xhci: Use struct_size() in kzalloc()

2019-01-08 Thread Gustavo A. R. Silva
foo) + sizeof(void *) * count, GFP_KERNEL); Instead of leaving these open-coded and prone to type mistakes, we can now use the new struct_size() helper: instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL); This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A

[PATCH] USB: core: urb: Use struct_size() in kmalloc()

2019-01-08 Thread Gustavo A. R. Silva
foo) + sizeof(void *) * count, GFP_KERNEL); Instead of leaving these open-coded and prone to type mistakes, we can now use the new struct_size() helper: instance = kmalloc(struct_size(instance, entry, count), GFP_KERNEL); This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A

Re: [PATCH] HID: hiddev: fix potential Spectre v1

2018-10-17 Thread Gustavo A. R. Silva
Hi Breno, On 10/17/18 9:47 PM, Breno Leitao wrote: > uref->usage_index can be indirectly controlled by userspace, hence leading > to a potential exploitation of the Spectre variant 1 vulnerability. > > This problem might show up in the cmd = HIDIOCGCOLLECTIONINDEX flow at > function > hiddev_i

[PATCH] usb: gadget: storage: Fix Spectre v1 vulnerability

2018-10-16 Thread Gustavo A. R. Silva
[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/function/f_mass_storage.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/ga

[PATCH] usb: core: fix compile warning

2018-09-11 Thread Gustavo A. R. Silva
Fix the following compile warning: warning: unused variable ‘flags’ [-Wunused-variable] unsigned long flags; Fixes: ed194d136769 ("usb: core: remove local_irq_save() around ->complete() handler") Signed-off-by: Gustavo A. R. Silva --- drivers/usb/core/hcd.c | 1 - 1 file change

[PATCH net-next] net: usbnet: mark expected switch fall-through

2018-09-03 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1077614 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva --- drivers/net/usb/usbnet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/d

Re: [PATCH v3] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-22 Thread Gustavo A. R. Silva
On 05/22/2018 10:56 AM, Shuah Khan wrote: On 05/18/2018 07:13 PM, Gustavo A. R. Silva wrote: pdev_nr and rhport can be controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: drivers/usb

Re: [PATCH v2] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-19 Thread Gustavo A. R. Silva
On 05/19/2018 02:04 AM, Greg Kroah-Hartman wrote: Greg, I've been talking with Dan Williams (intel) about this kind of issues [1] and it seems my original assumptions are correct. Hence, this patch is not useful and, in order to actually prevent speculation here we would need to pass the addr

[PATCH v3] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-18 Thread Gustavo A. R. Silva
ed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- Changes in v3: - Pass the addresses of pdev_nr and rhport into valid_port and valid_args. Changes in v2: - Place t

Re: [PATCH v2] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-18 Thread Gustavo A. R. Silva
On 05/18/2018 11:06 AM, Shuah Khan wrote: On 05/18/2018 07:47 AM, Greg Kroah-Hartman wrote: On Thu, May 17, 2018 at 03:16:28PM -0500, Gustavo A. R. Silva wrote: pdev_nr and rhport can be controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1

[PATCH v2] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-17 Thread Gustavo A. R. Silva
ed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Place the barriers into valid_port. drivers/usb/usbip/vhci_sysfs.c | 6 ++ 1 file changed, 6 insert

Re: [PATCH] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-17 Thread Gustavo A. R. Silva
On 05/17/2018 02:15 PM, Greg Kroah-Hartman wrote: Shouldn't we just do this in one place, in the valid_port() function? That way it keeps the range checking logic in one place (now it is in 3 places in the function), which should make maintenance much simpler. Yep, I thought about that, the

Re: [PATCH] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-17 Thread Gustavo A. R. Silva
Hi Greg, On 05/17/2018 01:51 AM, Greg Kroah-Hartman wrote: On Wed, May 16, 2018 at 05:22:00PM -0500, Gustavo A. R. Silva wrote: pdev_nr and rhport can be controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with

[PATCH] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-16 Thread Gustavo A. R. Silva
with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/usb/usbip/vhci_sysfs.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/usbip/vhci_sysfs.c b/drivers/

[PATCH] typec: tcpm: Fix incorrect 'and' operator

2018-04-30 Thread Gustavo A. R. Silva
Currently, logical and is being used instead of *bitwise* and. Fix this by using a proper bitwise and operator. Addresses-Coverity-ID: 1468455 ("Logical vs. bitwise operator") Fixes: 64f7c494a3c0 ("typec: tcpm: Add support for sink PPS related messages") Signed-off-by:

[PATCH] usb: core: hcd: mark expected switch fall-through

2018-04-23 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1468266 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva --- drivers/usb/core/hcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/d

[PATCH v2] USB: wusbcore: crypto: Remove VLA usage

2018-03-16 Thread Gustavo A. R. Silva
, in which case the code would look as follows instead: iv = kcalloc(crypto_skcipher_ivsize(tfm_cbc), sizeof(*iv), GFP_KERNEL); but if the data type of _iv_ never changes, or the type size is always one byte, kzalloc is good enough. Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Fix a

Re: [PATCH] USB: wusbcore: crypto: Remove VLA usage

2018-03-16 Thread Gustavo A. R. Silva
I just discovered an issue with this patch. Please, drop it. I'll send v2 shortly. Thanks -- Gustavo On 03/16/2018 08:01 AM, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA and replace it with dynamic memory allocation instead. The use of stack Variable L

[PATCH] USB: wusbcore: crypto: Remove VLA usage

2018-03-16 Thread Gustavo A. R. Silva
, in which case the code would look as follows instead: iv = kcalloc(crypto_skcipher_ivsize(tfm_cbc), sizeof(*iv), GFP_KERNEL); but if the data type of _iv_ never changes, or the type size is always one byte, kzalloc is good enough. Signed-off-by: Gustavo A. R. Silva --- drivers/usb/wusbcore

[PATCH] usb: dwc2: gadget: 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/usb/dwc2/gadget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b

[PATCH] USB: misc: chaoskey: 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/usb/misc/chaoskey.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/misc/chaoskey.c b

[PATCH] usb: gadget: compress return logic into one line

2018-01-18 Thread Gustavo A. R. Silva
Simplify return logic and avoid unnecessary variable assignment. Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/legacy/ncm.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/legacy/ncm.c b/drivers/usb/gadget/legacy/ncm.c index fcee1ee0

[PATCH] USB: usbip: remove useless call in usbip_recv

2018-01-02 Thread Gustavo A. R. Silva
Calling msg_data_left(&msg) is only useful for its return value, which in this particular case is ignored. Fix this by removing such call. Addresses-Coverity-ID: 1427080 Fixes: 90120d15f4c3 ("usbip: prevent leaking socket pointer address in messages") Signed-off-by: Gusta

[PATCH] usbnet: ipheth: fix potential null pointer dereference in ipheth_carrier_set

2017-11-17 Thread Gustavo A. R. Silva
e not ready") Signed-off-by: Gustavo A. R. Silva --- drivers/net/usb/ipheth.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c index ca71f6c..7275761 100644 --- a/drivers/net/usb/ipheth.c +++ b/drivers/net/us

Re: [PATCH 6/9] usb: host: isp1362-hcd: mark expected switch fall-through

2017-11-01 Thread Gustavo A. R. Silva
Quoting Greg Kroah-Hartman : On Wed, Oct 25, 2017 at 02:05:05PM -0500, Gustavo A. R. Silva wrote: Greg, Quoting "Gustavo A. R. Silva" : > In preparation to enabling -Wimplicit-fallthrough, mark switch cases > where we are expecting to fall through. > > Signed-off-b

[PATCH] usb: host: isp1362-hcd: fix missing break in switch

2017-11-01 Thread Gustavo A. R. Silva
Add missing break statement to prevent the code for case C_HUB_OVER_CURRENT from falling through to case C_HUB_LOCAL_POWER. Signed-off-by: Gustavo A. R. Silva --- drivers/usb/host/isp1362-hcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host

Re: [PATCH 6/9] usb: host: isp1362-hcd: mark expected switch fall-through

2017-11-01 Thread Gustavo A. R. Silva
rest of these patches are already in my tree. OK. I'll send a new patch shortly. Thanks! -- Gustavo A. R. Silva -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://

Re: [PATCH] USB: serial: io_edgeport: mark expected switch fall-throughs

2017-10-30 Thread Gustavo A. R. Silva
hrough" comment in the branch, but removing the else might be better. Thanks for the suggestion. This code is pretty hard to read as is and could really use some clean up... I agree. I'll send a V2 of this patch and then let's see if I can help with some code refactoring. Thank you -- Gustavo A. R. Silva -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] USB: serial: io_edgeport: mark expected switch fall-throughs

2017-10-28 Thread Gustavo A. R. Silva
Quoting Bjørn Mork : "Gustavo A. R. Silva" writes: In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case I replaced "...drop on through" comments with a proper "fall through

[PATCH] usb: typec: tps6598x: mark expected switch fall-through

2017-10-27 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/usb/typec/tps6598x.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/typec/tps6598x.c b/drivers/usb/typec/tps6598x.c index

[PATCH] usb: storage: sddr55: mark expected switch fall-through

2017-10-27 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/usb/storage/sddr55.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/storage/sddr55.c b/drivers/usb/storage/sddr55.c index

Re: [PATCH] usb: gadget: composite: mark expected switch fall-throughs

2017-10-26 Thread Gustavo A. R. Silva
Hi Felipe, Quoting Felipe Balbi : "Gustavo A. R. Silva" writes: In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Acked-by: Felipe Balbi Thank you for the ACKs. -- Gustavo A

[PATCH] usb: wusbcore: wa-xfer: mark expected switch fall-through

2017-10-25 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/usb/wusbcore/wa-xfer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/wusbcore/wa-xfer.c b/drivers/usb/wusbcore/wa-xfer.c

[PATCH 5/9] usb: host: ehci-hcd: mark expected switch fall-through

2017-10-25 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/usb/host/ehci-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci

[PATCH 1/9] usb: host: fotg210-hcd: mark expected switch fall-through

2017-10-25 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/usb/host/fotg210-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb

[PATCH 0/9] mark expected switch fall-throughs

2017-10-25 Thread Gustavo A. R. Silva
place. So I replaced them with proper "fall through" comments, which is what GCC is expecting to find. Thanks! Gustavo A. R. Silva (9): usb: host: fotg210-hcd: mark expected switch fall-through usb: host: xhci: mark expected switch fall-through usb: host: xhci-mem: mark expected s

[PATCH 4/9] usb: host: ohci-hcd: mark expected switch fall-through

2017-10-25 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/usb/host/ohci-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci

[PATCH 2/9] usb: host: xhci: mark expected switch fall-through

2017-10-25 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/usb/host/xhci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index ee077a2

Re: [PATCH 6/9] usb: host: isp1362-hcd: mark expected switch fall-through

2017-10-25 Thread Gustavo A. R. Silva
Greg, Quoting "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/usb/host/isp1362-hcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/driver

[PATCH 8/9] usb: host: xhci-hub: mark expected switch fall-through

2017-10-25 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/usb/host/xhci-hub.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index

[PATCH 9/9] usb: host: pci-quirks: mark expected switch fall-through

2017-10-25 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/usb/host/pci-quirks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host

[PATCH 6/9] usb: host: isp1362-hcd: mark expected switch fall-through

2017-10-25 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/usb/host/isp1362-hcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c

[PATCH 7/9] usb: host: oxu210hp-hcd: mark expected switch fall-through

2017-10-25 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/usb/host/oxu210hp-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb

[PATCH 3/9] usb: host: xhci-mem: mark expected switch fall-through

2017-10-25 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/usb/host/xhci-mem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index

[PATCH] usb: gadget: udc: dummy_hcd: mark expected switch fall-throughs

2017-10-25 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/usb/gadget/udc/dummy_hcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget

[PATCH] usb: gadget: composite: mark expected switch fall-throughs

2017-10-25 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/usb/gadget/composite.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/composite.c b/drivers

[PATCH] usb: class: usbtmc: mark expected switch fall-through

2017-10-24 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/usb/class/usbtmc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index

[PATCH] usb: atm: cxacru: mark expected switch fall-throughs

2017-10-24 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/usb/atm/cxacru.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index 600a670

[PATCH] usb: host: isp116x-hcd: mark expected switch fall-throughs

2017-10-24 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115006 Addresses-Coverity-ID: 115007 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/host/isp116x-hcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a

[PATCH] usb: gadget: f_phonet: mark expected switch fall-throughs

2017-10-24 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115004 Addresses-Coverity-ID: 115005 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/function/f_phonet.c | 2 ++ 1 file changed, 2 insertions(+) diff

[PATCH] usb: serial: kobil_sct: mark expected switch fall-through

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

[PATCH] usb: storage: uas: mark expected switch fall-through

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

[PATCH] usb: gadget: goku_udc: mark expected switch fall-throughs

2017-10-23 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 145713 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/udc/goku_udc.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a

[PATCH] usb: gadget: serial: mark expected switch fall-through

2017-10-23 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1350962 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/function/u_serial.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget

[PATCH] usb: musb_core: mark expected switch fall-through

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

[PATCH] usb: gadget: f_tcm: mark expected switch fall-through

2017-10-23 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 703128 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/function/f_tcm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/function

[PATCH] usb: core: urb: mark expected switch fall-through

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

[PATCH] usb: image: mdc800: mark expected switch fall-through

2017-10-23 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/usb/image/mdc800.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c index

[PATCH] usb: phy: phy-msm-usb: mark expected switch fall-through

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

[PATCH] usb: misc: ftdi-elan: fix duplicated code for different branches

2017-08-12 Thread Gustavo A. R. Silva
Refactor code in order to avoid identical code for different branches. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/usb/misc/ftdi-elan.c | 27 +-- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a

Re: [PATCH] usb: gadget: udc: renesas_usb3: fix error return code in renesas_usb3_probe()

2017-08-09 Thread Gustavo A. R. Silva
Hi Yoshihiro, On 08/09/2017 06:44 AM, Yoshihiro Shimoda wrote: Hi Gustavo, Thank you for the patch! I'm glad to help :) -Original Message- From: Gustavo A. R. Silva Sent: Wednesday, August 9, 2017 7:35 AM platform_get_irq() returns an error code, but the renesas_usb3 d

[PATCH] usb: ehci-omap: fix error return code in ehci_hcd_omap_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/usb/host/ehci-omap.c | 4 ++-- 1 file changed, 2

[PATCH] usb: gadget: udc: renesas_usb3: fix error return code in renesas_usb3_probe()

2017-08-08 Thread Gustavo A. R. Silva
/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af Print error message 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/usb/gadget/udc/renesas_usb3.c | 6

[PATCH] usb: dwc3: omap: fix error return code in dwc3_omap_probe()

2017-08-07 Thread Gustavo A. R. Silva
/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/usb/dwc3/dwc3-omap.c | 4 ++-- 1 file changed, 2

[PATCH] usb: imx21-hcd: fix error return code in imx21_probe()

2017-08-07 Thread Gustavo A. R. Silva
/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af Print error message 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/usb/host/imx21-hcd.c | 6 -- 1 file

Re: [PATCH] usb: isp1760: compress return logic into one line

2017-07-10 Thread Gustavo A. R. Silva
Hi Oliver, Quoting Oliver Neukum : Am Sonntag, den 09.07.2017, 21:00 -0500 schrieb Gustavo A. R. Silva : Simplify return logic to avoid unnecessary variable assignment. This issue was detected using Coccinelle and the following semantic patch: Hi, I need to ask: Where is the improvement

[PATCH] usb: gadget: fusb300_udc: compress return logic into one line

2017-07-09 Thread Gustavo A. R. Silva
Simplify return logic to avoid unnecessary variable declaration and assignment. 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/usb

[PATCH] usb: gadget: fsl_udc_core: compress return logic into one line

2017-07-09 Thread Gustavo A. R. Silva
Simplify return logic to avoid unnecessary variable assignment. This issue was 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/usb/gadget/udc

[PATCH] usb: misc: sisusbvga: compress return logic into one line

2017-07-09 Thread Gustavo A. R. Silva
Simplify return logic to avoid unnecessary variable declaration and assignment. 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/usb

[PATCH] usb: gadget: udc-xilinx: compress return logic into one line

2017-07-09 Thread Gustavo A. R. Silva
Simplify return logic to avoid unnecessary variable assignment. This issue was 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/usb/gadget/udc/udc

[PATCH] usb: misc: ftdi-elan: compress return logic into one line

2017-07-09 Thread Gustavo A. R. Silva
Simplify return logic to avoid unnecessary variable declaration and assignment. This issue was 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/usb/misc

[PATCH] usb: chipidea: udc: compress return logic into line

2017-07-09 Thread Gustavo A. R. Silva
Simplify return logic to avoid unnecessary variable assignment. This issue was 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/usb/chipidea/udc.c | 5

[PATCH] usb: gadget: legacy: compress return logic into one line

2017-07-09 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/usb/gadget/legacy

[PATCH 1/2] usb: gadget: compress return logic into one line

2017-07-09 Thread Gustavo A. R. Silva
Simplify return logic to avoid unnecessary variable declaration and assignment. This issue was 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/usb/gadget

[PATCH 2/2] usb: gadget: use unsigned int instead of unsigned in usb_otg_descriptor_alloc()

2017-07-09 Thread Gustavo A. R. Silva
Prefer unsigned int to bare use of unsigned. Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/config.c b/drivers/usb/gadget/config.c index 23bfa7d..968179d 100644 --- a/drivers/usb/gadget

[PATCH] usb: gadget: legacy: ncm: compress return logic into one line

2017-07-09 Thread Gustavo A. R. Silva
Simplify return logic to avoid unnecessary variable assignment. This issue was 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/usb/gadget/legacy/ncm.c

[PATCH] usb: gadget: legacy: dbgp: compress return logic into one line

2017-07-09 Thread Gustavo A. R. Silva
Simplify return logic to avoid unnecessary variable declaration and assignment. This issue was 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/usb/gadget

[PATCH] usb: gadget: configfs: compress return logic into one line

2017-07-09 Thread Gustavo A. R. Silva
Simplify return logic to avoid unnecessary variable assignment. This issue was 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/usb/gadget/configfs.c | 5

[PATCH] usb: isp1760: compress return logic into one line

2017-07-09 Thread Gustavo A. R. Silva
Simplify return logic to avoid unnecessary variable assignment. This issue was 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/usb/isp1760/isp1760-hcd.c

[PATCH] usb: gadget: function: constify snd_pcm_ops structure

2017-07-07 Thread Gustavo A. R. Silva
sion e1, e2; position p; @@ snd_pcm_set_ops(e1, e2, &i@p) @bad@ position p != {r.p,ok1.p,ok2.p}; identifier r.i; struct snd_pcm_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct snd_pcm_ops i = { ... }; Signed-off-by: Gustavo A. R. Silva ---

[PATCH] usb: gadget: udc-xilinx: remove useless variable assignment in xudc_read_fifo()

2017-06-27 Thread Gustavo A. R. Silva
Value assigned to variable bufferspace at line 637 is overwritten at line 613, before it can be used. This makes such variable assignment useless. Addresses-Coverity-ID: 1397677 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/udc/udc-xilinx.c | 1 - 1 file changed, 1 deletion(-) diff

[PATCH] usb: musb: compress return logic into one line

2017-06-20 Thread Gustavo A. R. Silva
Simplify return logic to avoid unnecessary variable assignment. Signed-off-by: Gustavo A. R. Silva --- drivers/usb/musb/musb_host.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index dbe617a..76decb8 100644

[PATCH] uwb: i1480: add missing goto

2017-05-19 Thread Gustavo A. R. Silva
Add missing goto. Addresses-Coverity-ID: 1226913 Signed-off-by: Gustavo A. R. Silva --- drivers/uwb/i1480/dfu/phy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/uwb/i1480/dfu/phy.c b/drivers/uwb/i1480/dfu/phy.c index 3b1a87d..1ac8526 100644 --- a/drivers/uwb/i1480/dfu/phy.c +++ b

  1   2   >