linux/drivers/net/can
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
..
c_can can: c_can_pci: fix compilation on non HAVE_CLK archs 2012-06-20 13:46:29 -07:00
cc770 can: cc770: fix sparse warning for cc770_interrupt 2012-07-02 11:07:24 +02:00
mscan can: mpc5xxx_can: make data in mpc5xxx_can_probe const 2012-07-17 09:35:59 +02:00
sja1000 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-05-22 19:22:50 -07:00
softing can: softing: softing_main: ensure a consistent return value in error case 2012-07-17 09:35:59 +02:00
usb can: usb: PCAN-USB Pro: fix mem leaks in pcan_usb_pro_init() on error paths 2012-04-16 21:34:50 +02:00
at91_can.c net/can: convert drivers/net/can/* to use module_platform_driver() 2011-11-29 00:25:05 -05:00
bfin_can.c drivers: net: Remove casts to same type 2012-06-06 09:31:33 -07:00
dev.c can: dev: fix sparse warning for can_restart 2012-07-02 11:07:25 +02:00
flexcan.c can: flexcan: make flexcan_priv.devtype_data member point to const data 2012-07-17 09:35:58 +02:00
janz-ican3.c net/can: convert drivers/net/can/* to use module_platform_driver() 2011-11-29 00:25:05 -05:00
Kconfig can: Kconfig: add more information about Intel EG20T PCH CAN controller 2012-02-03 01:21:26 +01:00
Makefile can: cc770: add driver core for the Bosch CC770 and Intel AN82527 2011-12-01 13:09:31 -05:00
mcp251x.c drivers: net: Remove casts to same type 2012-06-06 09:31:33 -07:00
pch_can.c net/can: use module_pci_driver 2012-04-16 21:08:18 +02:00
slcan.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
ti_hecc.c Merge branch 'master' of git://gitorious.org/linux-can/linux-can-next 2012-02-04 16:42:19 -05:00
vcan.c vcan: add CAN FD support 2012-06-19 21:40:20 +02:00