linux/drivers/net
Julia Lawall da78b7998e can: softing: softing_main: ensure a consistent return value in error case
Typically, the return value desired for the failure of a function with an
integer return value is a negative integer.  In these cases, the return
value is sometimes a negative integer and sometimes 0, due to a subsequent
initialization of the return variable within the loop.

A simplified version of the semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)

//<smpl>
@r exists@
identifier ret;
position p;
constant C;
expression e1,e3,e4;
statement S;
@@

ret = -C
... when != ret = e3
    when any
if@p (...) S
... when any
if (\(ret != 0\|ret < 0\|ret > 0\) || ...) { ... return ...; }
... when != ret = e3
    when any
*if@p (...)
{
  ... when != ret = e4
  return ret;
}
//</smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-07-17 09:35:59 +02:00
..
appletalk drivers: net: Remove casts to same type 2012-06-06 09:31:33 -07:00
arcnet
bonding Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-07-10 23:56:33 -07:00
caif caif-hsi: Fix merge issues. 2012-06-29 00:46:53 -07:00
can can: softing: softing_main: ensure a consistent return value in error case 2012-07-17 09:35:59 +02:00
cris net: Properly define functions with no parameters 2012-07-10 23:13:45 -07:00
dsa
ethernet bnx2: Try to recover from PCI block reset 2012-07-16 23:12:02 -07:00
fddi drivers: net: Remove casts to same type 2012-06-06 09:31:33 -07:00
hamradio drivers: net: Remove casts to same type 2012-06-06 09:31:33 -07:00
hippi
hyperv hyperv: Add support for setting MAC from within guests 2012-07-16 22:54:24 -07:00
irda drivers: net: Remove casts to same type 2012-06-06 09:31:33 -07:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-07-10 23:56:33 -07:00
plip
ppp
slip drivers: net: Remove casts to same type 2012-06-06 09:31:33 -07:00
team team: make team_port_enabled() and team_port_txable() static inline 2012-07-12 08:08:20 -07:00
usb net: usb: Use eth_random_addr 2012-07-16 22:38:28 -07:00
vmxnet3 drivers: net: Remove casts to same type 2012-06-06 09:31:33 -07:00
wan drivers: net: Remove casts to same type 2012-06-06 09:31:33 -07:00
wimax drivers/net: Use eth_random_addr 2012-07-16 22:38:28 -07:00
wireless wireless: Use eth_random_addr 2012-07-16 22:38:28 -07:00
xen-netback xen/netback: only non-freed SKB is queued into tx_queue 2012-06-29 00:50:20 -07:00
dummy.c dummy: use IFF_LIVE_ADDR_CHANGE priv_flag 2012-06-30 01:08:00 -07:00
eql.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macvlan.c
macvtap.c macvtap: use prepare_to_wait/finish_wait to ensure mb 2012-06-07 13:18:54 -07:00
Makefile
mdio.c
mii.c
netconsole.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c drivers/net: Use eth_random_addr 2012-07-16 22:38:28 -07:00
veth.c
virtio_net.c virtio_net: use IFF_LIVE_ADDR_CHANGE priv_flag 2012-06-30 01:08:00 -07:00
xen-netfront.c xen/netfront: teardown the device before unregistering it. 2012-06-27 01:25:41 -07:00