[PATCH] tcp_nv: fix potential integer overflow in tcpnv_acked

2018-01-30 Thread Gustavo A. R. Silva
and the external cast to u64. Addresses-Coverity-ID: 1357588 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva <gust...@embeddedor.com> --- net/ipv4/tcp_nv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_nv.c b/net/ipv4/tcp_nv.c index ddbce73

Re: [PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na

2018-01-23 Thread Gustavo A. R. Silva
Quoting David Miller : [..] Please don't use the word "fix". '0' is the same as 'false', it's just that the latter is more consistent type wise. So "Use true and false for boolean value" would be a better subject? Yes. I got it. Thanks -- Gustavo

Re: [PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na

2018-01-23 Thread Gustavo A. R. Silva
Quoting David Miller <da...@davemloft.net>: From: "Gustavo A. R. Silva" <garsi...@embeddedor.com> Date: Mon, 22 Jan 2018 16:22:13 -0600 Assign true or false to boolean variables instead of an integer value. This issue was detected with the help of Coccinelle. Fixes

Re: [PATCH v2] smc: return booleans instead of integers

2018-01-22 Thread Gustavo A. R. Silva
Quoting Ursula Braun : [...] Thanks, Gustavo. I have added the patch to our local repository. It will be part of one of my next patch sets to be sent to Dave Miller. Thanks, Ursula :) -- Gustavo

[PATCH] net: caif: fix boolean assignments

2018-01-22 Thread Gustavo A. R. Silva
later") Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/caif/caif_dev.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c index e0adcd1..f2848d6 100644 --- a/net/caif/caif_dev.c +++ b/net/caif/c

[PATCH] tipc: bcast: fix boolean assignment in tipc_nlist_purge

2018-01-22 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. Fixes: 2ae0b8af1fe3 ("tipc: add functionality to lookup multicast destination nodes") Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> ---

[PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na

2018-01-22 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. Fixes: 1cb3fe513f62 ("ndisc: Break down ndisc_build_skb() and build message directly.") Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> ---

[PATCH] xfrm: fix boolean assignment in xfrm_get_type_offload

2018-01-22 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. Fixes: ffdb5211da1c ("xfrm: Auto-load xfrm offload modules") Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/xfrm/xfrm_state.c | 2 +-

[PATCH v2] smc: return booleans instead of integers

2018-01-19 Thread Gustavo A. R. Silva
Return statements in functions returning bool should use true/false instead of 1/0. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gust...@embeddedor.com> --- Changes in v2: - Fix function using_ipsec as suggested by Ursula Braun. - Update subjec

Re: [PATCH] smc: return boolean instead of integer in using_ipsec

2018-01-19 Thread Gustavo A. R. Silva
Hi Ursula, Quoting Ursula Braun <ubr...@linux.vnet.ibm.com>: On 01/19/2018 12:33 AM, Gustavo A. R. Silva wrote: Return statements in functions returning bool should use true/false instead of 1/0. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva

Re: [PATCH] bridge: return boolean instead of integer in br_multicast_is_router

2018-01-18 Thread Gustavo A. R. Silva
Quoting Stephen Hemminger <step...@networkplumber.org>: On Thu, 18 Jan 2018 17:37:45 -0600 "Gustavo A. R. Silva" <garsi...@embeddedor.com> wrote: Return statements in functions returning bool should use true/false instead of 1/0. This issue was detected with the help

[PATCH] bridge: return boolean instead of integer in br_multicast_is_router

2018-01-18 Thread Gustavo A. R. Silva
Return statements in functions returning bool should use true/false instead of 1/0. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/bridge/br_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH] netfilter: return booleans instead of integers

2018-01-18 Thread Gustavo A. R. Silva
Return statements in functions returning bool should use true/false instead of 1/0. These issues were detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/netfilter/nf_conncount.c | 2 +- net/netfilter/xt_hashlimit.c | 2 +- net/net

[PATCH] smc: return boolean instead of integer in using_ipsec

2018-01-18 Thread Gustavo A. R. Silva
Return statements in functions returning bool should use true/false instead of 1/0. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/smc/smc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/n

[PATCH] phylink: mark expected switch fall-throughs in phylink_mii_ioctl

2018-01-05 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1463447 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- This code was compiled with GCC 7.2.0

[PATCH v3] rxrpc: Fix variable overwrite

2017-11-28 Thread Gustavo A. R. Silva
: beb8e5e4f38c ("rxrpc: Express protocol timeouts in terms of RTT") Link: https://marc.info/?i=17004.1511808959%40warthog.procyon.org.uk Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- Changes in v2: - Add 'now' to the previously-computed value stored in resend_at instea

Re: [PATCH] rxrpc: call_event: Fix variable overwrite in __rxrpc_propose_ACK

2017-11-28 Thread Gustavo A. R. Silva
Quoting David Howells <dhowe...@redhat.com>: Gustavo A. R. Silva <garsi...@embeddedor.com> wrote: - ack_at = jiffies + expiry; Same issue as with the other patch. Can you just combine the two please? Sure. I'll send a patch shortly. Thanks -- Gustavo A. R. Silva

Re: [PATCH] rxrpc: sendmsg: Fix variable overwrite in rxrpc_queue_packet

2017-11-27 Thread Gustavo A. R. Silva
Quoting David Howells <dhowe...@redhat.com>: Gustavo A. R. Silva <garsi...@embeddedor.com> wrote: - resend_at = now + rxrpc_resend_timeout; + resend_at += now; Yep. :-) Great! What about this one: https://lkml.org/lkml/2017/11/27/810 appl

[PATCH v2] rxrpc: sendmsg: Fix variable overwrite in rxrpc_queue_packet

2017-11-27 Thread Gustavo A. R. Silva
rc.info/?i=17004.1511808959%40warthog.procyon.org.uk Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- Changes in v2: Update value in resend_at instead of removing the code. net/rxrpc/sendmsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rxrpc/sendm

Re: [PATCH] rxrpc: sendmsg: Fix variable overwrite in rxrpc_queue_packet

2017-11-27 Thread Gustavo A. R. Silva
Hi David, Quoting David Howells <dhowe...@redhat.com>: Gustavo A. R. Silva <garsi...@embeddedor.com> wrote: Value assigned to variable resend_at is overwritten before it can be used. Fix this by removing the value overwrite as it seems that this is a leftover code. NA

[PATCH] rxrpc: call_event: Fix variable overwrite in __rxrpc_propose_ACK

2017-11-27 Thread Gustavo A. R. Silva
t;) Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/rxrpc/call_event.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c index bda952f..03074ba 100644 --- a/net/rxrpc/call_event.c +++ b/net/rxrpc/call_event.c @@ -123,7

[PATCH] rxrpc: sendmsg: Fix variable overwrite in rxrpc_queue_packet

2017-11-27 Thread Gustavo A. R. Silva
Value assigned to variable resend_at is overwritten before it can be used. Fix this by removing the value overwrite as it seems that this is a leftover code. Addresses-Coverity-ID: 1462262 Fixes: beb8e5e4f38c ("rxrpc: Express protocol timeouts in terms of RTT") Signed-off-by: Gustavo A

Re: [PATCH] net: openvswitch: datapath: fix data type in queue_gso_packets

2017-11-27 Thread Gustavo A. R. Silva
Quoting David Miller <da...@davemloft.net>: From: Willem de Bruijn <willemdebruijn.ker...@gmail.com> Date: Sat, 25 Nov 2017 16:15:01 -0500 On Sat, Nov 25, 2017 at 2:14 PM, Gustavo A. R. Silva <garsi...@embeddedor.com> wrote: gso_type is being used in binary AND o

[PATCH] net: openvswitch: datapath: fix data type in queue_gso_packets

2017-11-25 Thread Gustavo A. R. Silva
s zero, hence making some code unreachable and likely causing undesired behavior. Fix this by changing the data type of variable gso_type to unsigned int. Addresses-Coverity-ID: 1462223 Fixes: 0c19f846d582 ("net: accept UFO datagrams from tuntap and packet") Signed-off-by: Gustavo A.

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

2017-11-17 Thread Gustavo A. R. Silva
evice not ready") Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- 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

[PATCH] openvswitch: meter: fix NULL pointer dereference in ovs_meter_cmd_reply_start

2017-11-14 Thread Gustavo A. R. Silva
in order to avoid a pontential null pointer dereference. Addresses-Coverity-ID: 1461561 ("Dereference before null check") Addresses-Coverity-ID: 1461562 ("Dereference null return value") Fixes: 96fbc13d7e77 ("openvswitch: Add meter infrastructure") Signed-off-

[PATCH] net: wan: x25_asy: mark expected switch fall-through

2017-11-08 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114928 Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- drivers/net/wan/x25_asy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drive

[PATCH] net: 3com: 3c574_cs: mark expected switch fall-through

2017-11-08 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114888 Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- drivers/net/ethernet/3com/3c574_cs.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH] net: 8390: pcnet_cs: mark expected switch fall-through

2017-11-08 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 114891 Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- drivers/net/ethernet/8390/pcnet_cs.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH] net: decnet: dn_table: mark expected switch fall-through

2017-11-08 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115106 Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/decnet/dn_table.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/

Re: [PATCH] net/mlx5e/core/en_fs: fix pointer dereference after free in mlx5e_execute_l2_action

2017-11-08 Thread Gustavo A. R. Silva
Quoting David Miller <da...@davemloft.net>: From: "Gustavo A. R. Silva" <garsi...@embeddedor.com> Date: Sat, 4 Nov 2017 22:54:53 -0500 hn is being kfree'd in mlx5e_del_l2_from_hash and then dereferenced by accessing hn->ai.addr Fix this by copying the MAC addr

[PATCH] fsl/fman_port: mark expected switch fall-throughs

2017-11-08 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1397960 Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- drivers/net/ethernet/freescale/fman/fman_port.c | 2 ++ 1 file changed, 2 inse

[PATCH] net: ethernet: bgmac: mark expected switch fall-through

2017-11-08 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1397972 Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- drivers/net/ethernet/broadcom/bgmac-platform.c | 1 + 1 file changed, 1 insertion(+)

[PATCH v2] netfilter: mark expected switch fall-throughs

2017-11-07 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1128839 Addresses-Coverity-ID: 1128840 Addresses-Coverity-ID: 115120 Addresses-Coverity-ID: 115121 Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.

Re: [PATCH] netfilter: mark expected switch fall-throughs

2017-11-07 Thread Gustavo A. R. Silva
Hello Pablo, Quoting Pablo Neira Ayuso <pa...@netfilter.org>: Hi Gustavo, On Thu, Oct 19, 2017 at 09:06:16AM -0500, Gustavo A. R. Silva wrote: diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c index cf84f7b..72f654a 100644 --- a/net/netfilter

[PATCH] rsi: rsi_91x_ps: remove redundant code in str_psstate

2017-11-06 Thread Gustavo A. R. Silva
"INVALID_STATE" is already being returned in the default case and this code cannot be reached. Addresses-Coverity-ID: 1398384 Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- drivers/net/wireless/rsi/rsi_91x_ps.c | 1 - 1 file changed, 1 deletion(-) diff --g

Re: [PATCH] net/mlx5e/core/en_fs: fix pointer dereference after free in mlx5e_execute_l2_action

2017-11-05 Thread Gustavo A. R. Silva
Hi Saeed, Quoting Saeed Mahameed <sae...@dev.mellanox.co.il>: On Sat, Nov 4, 2017 at 8:54 PM, Gustavo A. R. Silva <garsi...@embeddedor.com> wrote: hn is being kfree'd in mlx5e_del_l2_from_hash and then dereferenced by accessing hn->ai.addr Fix this by copying the MAC addre

[PATCH] net/mlx5e/core/en_fs: fix pointer dereference after free in mlx5e_execute_l2_action

2017-11-04 Thread Gustavo A. R. Silva
826 ("net/mlx5: Separate between E-Switch and MPFS") Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core

[PATCH] ath9k: dfs: use swap macro in ath9k_check_chirping

2017-11-03 Thread Gustavo A. R. Silva
Make use of the swap macro and remove unnecessary variable temp. 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 <garsi...@embeddedor.com> --- drivers/net/wireless/ath/ath9k/dfs.c | 8 +++-

[PATCH] mISDN: l1oip_core: replace _manual_ swap with swap macro

2017-11-03 Thread Gustavo A. R. Silva
Make use of the swap macro and remove unnecessary variables skb and cnt. 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 <garsi...@embeddedor.com> --- drivers/isdn/mISDN/l1oip_core.c | 10 ++

[PATCH] net: plip: mark expected switch fall-throughs

2017-11-03 Thread Gustavo A. R. Silva
Addresses-Coverity-ID: 114899 Addresses-Coverity-ID: 114900 Addresses-Coverity-ID: 114901 Addresses-Coverity-ID: 114902 Addresses-Coverity-ID: 114903 Addresses-Coverity-ID: 114904 Addresses-Coverity-ID: 114905 Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- drivers/net/plip/plip.

[PATCH] ISDN: eicon: message: mark expected switch fall-throughs

2017-11-02 Thread Gustavo A. R. Silva
Addresses-Coverity-ID: 200521 Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- drivers/isdn/hardware/eicon/message.c | 70 +-- 1 file changed, 58 insertions(+), 12 deletions(-) diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware

Re: [PATCH v3 0/2] refactor code and mark expected switch fall-throughs

2017-11-01 Thread Gustavo A. R. Silva
Quoting David Miller <da...@davemloft.net>: From: "Gustavo A. R. Silva" <garsi...@embeddedor.com> Date: Fri, 27 Oct 2017 00:50:57 -0500 The aim of this patchset is firstly to refactor code in nr_route.c in order to make it easier to read and maintain and, secondly,

[PATCH] ieee802154: mrf24j40: fix incorrect mask in mrf24j40_stop

2017-10-31 Thread Gustavo A. R. Silva
It seems that this is a copy/paste error and the proper bit masking is: BIT_TXNIE | BIT_RXIE This issue was detected with the help of Coccinelle. Reported-by: Julia Lawall <julia.law...@lip6.fr> Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> Fixes: 7d840545e5b9 ("

Re: [PATCH] net: caif: chnl_net: remove unnecessary null check in chnl_recv_cb

2017-10-30 Thread Gustavo A. R. Silva
Quoting "Gustavo A. R. Silva" <garsi...@embeddedor.com>: Quoting "Gustavo A. R. Silva" <garsi...@embeddedor.com>: Hi, Quoting "Gustavo A. R. Silva" <garsi...@embeddedor.com>: container_of is never null, so this null check is unnecessary. Th

Re: [PATCH] net: caif: chnl_net: remove unnecessary null check in chnl_recv_cb

2017-10-30 Thread Gustavo A. R. Silva
Quoting "Gustavo A. R. Silva" <garsi...@embeddedor.com>: Hi, Quoting "Gustavo A. R. Silva" <garsi...@embeddedor.com>: container_of is never null, so this null check is unnecessary. This code was detected with the help of Coccinelle. Signed-of

Re: [PATCH] net: caif: chnl_net: remove unnecessary null check in chnl_recv_cb

2017-10-30 Thread Gustavo A. R. Silva
Hi, Quoting "Gustavo A. R. Silva" <garsi...@embeddedor.com>: container_of is never null, so this null check is unnecessary. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/caif/chnl_net.c | 2

[PATCH] net: caif: chnl_net: remove unnecessary null check in chnl_recv_cb

2017-10-30 Thread Gustavo A. R. Silva
container_of is never null, so this null check is unnecessary. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/caif/chnl_net.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/caif/chnl_net.c b/net/caif/chnl

[PATCH] netfilter: ipset: use swap macro instead of _manually_ swapping values

2017-10-30 Thread Gustavo A. R. Silva
Make use of the swap macro and remove unnecessary variables 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 <garsi...@embeddedor.com> --- net/netfilter/ipset/ip_set_bitmap_ip.c| 8 ++-

Re: [PATCH] netfilter: ipset: ip_set_bitmap_ipmac: use swap macro in bitmap_ipmac_create

2017-10-30 Thread Gustavo A. R. Silva
Hi Jozsef, Quoting Jozsef Kadlecsik <kad...@blackhole.kfki.hu>: Hi, On Sat, 28 Oct 2017, Gustavo A. R. Silva wrote: Make use of the swap macro and remove unnecessary variable tmp. This makes the code easier to read and maintain. This code was detected with the help of Coccinelle.

Re: [PATCH] ipv6: exthdrs: use swap macro in ipv6_dest_hao

2017-10-28 Thread Gustavo A. R. Silva
Quoting David Miller <da...@redhat.com>: From: "Gustavo A. R. Silva" <garsi...@embeddedor.com> Date: Thu, 26 Oct 2017 23:10:35 -0500 make use of the swap macro and remove unnecessary variable tmp_addr. This makes the code easier to read and maintain. This code was

[PATCH] net: dccp: ccids: lib: packet_history: use swap macro in tfrc_rx_hist_swap

2017-10-28 Thread Gustavo A. R. Silva
Make use of the swap macro 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 <garsi...@embeddedor.com> --- net/dccp/ccids/lib/packet_history.c | 4 +--- 1 file chan

[PATCH] net: decnet: dn_nsp_out: use swap macro in dn_mk_ack_header

2017-10-28 Thread Gustavo A. R. Silva
Make use of the swap macro 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 <garsi...@embeddedor.com> --- net/decnet/dn_nsp_out.c | 7 ++- 1 file changed, 2 inse

[PATCH] netfilter: ipset: ip_set_bitmap_port: use swap macro in bitmap_port_create

2017-10-28 Thread Gustavo A. R. Silva
Make use of the swap macro 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 <garsi...@embeddedor.com> --- net/netfilter/ipset/ip_set_bitmap_port.c | 8 ++--

[PATCH] netfilter: ipset: ip_set_bitmap_ip: use swap macro in bitmap_ip_create

2017-10-28 Thread Gustavo A. R. Silva
Make use of the swap macro 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 <garsi...@embeddedor.com> --- net/netfilter/ipset/ip_set_bitmap_ip.c | 8 ++--

[PATCH] netfilter: ipset: ip_set_bitmap_ipmac: use swap macro in bitmap_ipmac_create

2017-10-28 Thread Gustavo A. R. Silva
Make use of the swap macro 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 <garsi...@embeddedor.com> --- net/netfilter/ipset/ip_set_bitmap_ipmac.c | 8 ++--

[PATCH] net: decnet: dn_nsp_in: use swap macro in dn_nsp_rx_packet

2017-10-28 Thread Gustavo A. R. Silva
Make use of the swap macro 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 <garsi...@embeddedor.com> --- net/decnet/dn_nsp_in.c | 8 ++-- 1 file changed, 2 inse

Re: [PATCH v2] net: xfrm_user: use BUG_ON instead of if condition followed by BUG

2017-10-27 Thread Gustavo A. R. Silva
Quoting Steffen Klassert <steffen.klass...@secunet.com>: On Thu, Oct 26, 2017 at 06:31:35AM -0500, Gustavo A. R. Silva wrote: Use BUG_ON instead of if condition followed by BUG. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embed

Re: [PATCH v3 0/2] refactor code and mark expected switch fall-throughs

2017-10-27 Thread Gustavo A. R. Silva
utes with a call to the swap macro. Thanks -- Gustavo A. R. Silva I'm willing to try and help here but I really would like to follow some team's guidelines of how they would like tests to be created, supported, etc. Be it in VMs, containers, specific automation languages, etc. --David KI6

[PATCH v3 0/2] refactor code and mark expected switch fall-throughs

2017-10-27 Thread Gustavo A. R. Silva
as suggested by David Miller. Gustavo A. R. Silva (2): net: netrom: nr_route: refactor code in nr_add_node net: netrom: nr_route: mark expected switch fall-throughs net/netrom/nr_route.c | 62 --- 1 file changed, 19 insertions(+), 43 deletions

[PATCH v3 1/2] net: netrom: nr_route: refactor code in nr_add_node

2017-10-26 Thread Gustavo A. R. Silva
Code refactoring in order to make the code easier to read and maintain. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- Changes in v2: Make use of the swap macro and remove inline keyword. Changes in v3: Update subject. net/netrom/nr_route.

[PATCH v3 2/2] net: netrom: nr_route: mark expected switch fall-throughs

2017-10-26 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 <garsi...@embeddedor.com> --- Changes in v2: None. Changes in v3: Update subject. net/netrom/nr_route.c | 3 +++ 1 file changed, 3 inse

Re: [PATCH v2] ipv6: esp6: use BUG_ON instead of if condition followed by BUG

2017-10-26 Thread Gustavo A. R. Silva
Quoting Herbert Xu <herb...@gondor.apana.org.au>: On Thu, Oct 26, 2017 at 07:51:06AM -0500, Gustavo A. R. Silva wrote: Use BUG_ON instead of if condition followed by BUG in esp_remove_trailer. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva

[PATCH] ipv6: exthdrs: use swap macro in ipv6_dest_hao

2017-10-26 Thread Gustavo A. R. Silva
make use of the swap macro and remove unnecessary variable tmp_addr. 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 <garsi...@embeddedor.com> --- net/ipv6/exthdrs.c | 5 + 1 file changed, 1 ins

[PATCH v2] ipv6: esp6: use BUG_ON instead of if condition followed by BUG

2017-10-26 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG in esp_remove_trailer. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- Changes in v2: Update the code as suggested by Herbert Xu: ret = foo(); BUG_ON(ret); net/ipv

[PATCH] net: faraday: ftmac100: Use BUG_ON instead of if condition followed by BUG.

2017-10-26 Thread Gustavo A. R. Silva
Notice that in this particular case unlikely() is already being called inside BUG_ON macro. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- drivers/net/ethernet/faraday/ftmac100.c | 5 +++-- 1 file changed, 3 insertions

[PATCH] net: bcmgenet: Use BUG_ON instead of if condition followed by BUG

2017-10-26 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG. Something to notice in this particular case is that unlikely() is already being called inside BUG_ON macro. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- drive

[PATCH v2] net: xfrm_user: use BUG_ON instead of if condition followed by BUG

2017-10-26 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- Changes in v2: Update the code as suggested by Herbert Xu: int err; err = foo(); BUG_ON(err < 0); net/xfrm/xf

Re: [PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG

2017-10-26 Thread Gustavo A. R. Silva
Hi Herbert, Quoting Herbert Xu <herb...@gondor.apana.org.au>: On Wed, Oct 25, 2017 at 07:38:35PM -0500, Gustavo A. R. Silva wrote: I don't think we want something like: bool err; err = build_spdinfo(r_skb, net, sportid, seq, *flags) < 0 ? true : false; BUG_ON(err); How about

Re: [PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG

2017-10-25 Thread Gustavo A. R. Silva
Quoting "Gustavo A. R. Silva" <garsi...@embeddedor.com>: Hi all, Quoting Steffen Klassert <steffen.klass...@secunet.com>: On Wed, Oct 25, 2017 at 01:22:22PM +0900, David Miller wrote: From: Herbert Xu <herb...@gondor.apana.org.au> Date: Wed, 25 Oct 2017 12:

Re: [PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG

2017-10-25 Thread Gustavo A. R. Silva
we have an agreement on the above version, Gustavo can you please update your patches to this? I can do that. I'll work on a patchset for this. Thanks -- Gustavo A. R. Silva

Re: [PATCH] rxrpc: recvmsg: use BUG_ON instead of if condition followed by BUG

2017-10-24 Thread Gustavo A. R. Silva
What about WARN_ON_ONCE instead? Thanks -- Gustavo A. R. Silva Tom On Tue, Oct 24, 2017 at 9:20 AM, Gustavo A. R. Silva <garsi...@embeddedor.com> wrote: Use BUG_ON instead of if condition followed by BUG. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R.

Re: [PATCH] net: sunrpc: svcauth_gss: use BUG_ON instead of if condition followed by BUG

2017-10-24 Thread Gustavo A. R. Silva
v_tmpcnt--; spin_unlock_bh(>sv_lock); while ((dr = svc_deferred_dequeue(xprt)) != NULL) kfree(dr); call_xpt_users(xprt); svc_xprt_put(xprt); } I'm suspicious about that comment above the _if_ condition: /* Only do this once */ Would it help to replace that BUG with a WARN_ON_ONCE? Thanks -- Gustavo A. R. Silva

[PATCH] ipv6: esp6: use BUG_ON instead of if condition followed by BUG

2017-10-24 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG in esp_remove_trailer. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/ipv6/esp6.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/ipv6/es

[PATCH] rxrpc: key: use BUG_ON instead of if condition followed by BUG

2017-10-24 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/rxrpc/key.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/rxrpc/key.c b/net/rxrpc/key.c

[PATCH] rxrpc: call_accept: use BUG_ON instead of if condition followed by BUG

2017-10-24 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/rxrpc/call_accept.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/rxrpc/call_acce

[PATCH] rxrpc: recvmsg: use BUG_ON instead of if condition followed by BUG

2017-10-24 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/rxrpc/recvmsg.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/rxrpc/recvmsg.c b/net

[PATCH] net: rxrpc: rxkad: use BUG_ON instead of if condition followed by BUG

2017-10-24 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/rxrpc/rxkad.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/net/rxrpc/r

Re: [PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread Gustavo A. R. Silva
Quoting Herbert Xu <herb...@gondor.apana.org.au>: On Mon, Oct 23, 2017 at 10:50:43PM -0500, Gustavo A. R. Silva wrote: Quoting Herbert Xu <herb...@gondor.apana.org.au>: >On Mon, Oct 23, 2017 at 01:18:57PM -0500, Gustavo A. R. Silva wrote: >>Use BUG_ON instead of if cond

Re: [PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread Gustavo A. R. Silva
Quoting Herbert Xu <herb...@gondor.apana.org.au>: On Mon, Oct 23, 2017 at 01:18:57PM -0500, Gustavo A. R. Silva wrote: Use BUG_ON instead of if condition followed by BUG. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor

[PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/xfrm/xfrm_user.c | 28 ++-- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git

[PATCH] net: sunrpc: svcauth_gss: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/sunrpc/auth_gss/svcauth_gss.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/net/

[PATCH] net: rxrpc: call_object: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG in rxrpc_release_call. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/rxrpc/call_object.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net

[PATCH] ipv4: tcp_minisocks: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG in tcp_time_wait. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/ipv4/tcp_minisocks.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ne

[PATCH] ipv4: icmp: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG in icmp_timestamp. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/ipv4/icmp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ic

[PATCH] ipv4: esp4: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG in esp_remove_trailer. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- net/ipv4/esp4.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/ipv4/es

Re: [PATCH v2 2/2] net: netrom: refactor code in nr_add_node

2017-10-22 Thread Gustavo A. R. Silva
Quoting David Miller <da...@davemloft.net>: From: "Gustavo A. R. Silva" <garsi...@embeddedor.com> Date: Sun, 22 Oct 2017 20:08:40 -0500 Code refactoring in order to make it easier to read and maintain. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.co

[PATCH v2 2/2] net: netrom: refactor code in nr_add_node

2017-10-22 Thread Gustavo A. R. Silva
Code refactoring in order to make it easier to read and maintain. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- This code was tested by compilation only. Changes in v2: Make use of the swap macro and remove inline keyword. net/netrom/nr_route.

Re: [PATCH 2/2] net: netrom: refactor code in nr_add_node

2017-10-22 Thread Gustavo A. R. Silva
Quoting walter harms <wha...@bfs.de>: Am 20.10.2017 18:06, schrieb Gustavo A. R. Silva: Hi Walter, Quoting walter harms <wha...@bfs.de>: Am 19.10.2017 19:27, schrieb Gustavo A. R. Silva: Code refactoring in order to make the code easier to read and maintain. Signed-off-by:

[PATCH v2] net: smc_close: mark expected switch fall-through

2017-10-21 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case I placed the "fall through" comment on its own line, which is what GCC is expecting to find. Signed-off-by: Gustavo A. R. Si

Re: [PATCH] net: smc_close: mark expected switch fall-throughs

2017-10-21 Thread Gustavo A. R. Silva
Quoting David Miller <da...@davemloft.net>: From: "Gustavo A. R. Silva" <garsi...@embeddedor.com> Date: Thu, 19 Oct 2017 17:02:44 -0500 @@ -360,7 +360,8 @@ static void smc_close_passive_work(struct work_struct *work) case SMC_PEERCLOSEWAIT1:

[PATCH] net: can: dev: remove unused code in can_restart

2017-10-20 Thread Gustavo A. R. Silva
Value assigned to variable err is overwritten at line 562: err = priv->do_set_mode(dev, CAN_MODE_START); before it can be used. Also, notice that this code has been there since 2014. Addresses-Coverity-ID: 1227031 Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> ---

[PATCH] net: core: rtnetlink: use BUG_ON instead of if condition followed by BUG

2017-10-20 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG in do_setlink. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- This code was tested by compilation only. net/core/rtnetlink.c | 3 +-- 1 file changed, 1 insertion

[PATCH] net: x25: mark expected switch fall-throughs

2017-10-20 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 <garsi...@embeddedor.com> --- This code was tested by compilation only (GCC 7.2.0 was used). Please, verify if the actual intention of th

[PATCH] net: af_unix: mark expected switch fall-through

2017-10-20 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 <garsi...@embeddedor.com> --- This code was tested by compilation only (GCC 7.2.0 was used). Please, verify if the actual intention of th

[PATCH] net: tipc: mark expected switch fall-throughs

2017-10-20 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 <garsi...@embeddedor.com> --- This code was tested by compilation only (GCC 7.2.0 was used). Please, verify if the actual intention of th

[PATCH] net: wireless: mark expected switch fall-throughs

2017-10-20 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 <garsi...@embeddedor.com> --- This code was tested by compilation only (GCC 7.2.0 was used). Please, verify if the actual intention of th

[PATCH] net: sunrpc: mark expected switch fall-throughs

2017-10-20 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 <garsi...@embeddedor.com> --- This code was tested by compilation only (GCC 7.2.0 was used). Please, verify if the actual intention of th

Re: [PATCH 2/2] net: netrom: refactor code in nr_add_node

2017-10-20 Thread Gustavo A. R. Silva
Hi Walter, Quoting walter harms <wha...@bfs.de>: Am 19.10.2017 19:27, schrieb Gustavo A. R. Silva: Code refactoring in order to make the code easier to read and maintain. Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> --- This code was tested by compilation onl

[PATCH] net: smc_close: mark expected switch fall-throughs

2017-10-19 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case I placed a "fall through" comment on its own line, which is what GCC is expecting to find. Signed-off-by: Gustavo A. R. Silva <garsi...@e

<    1   2   3   4   >