linux/drivers/isdn/gigaset
Peter Senna Tschudin 7f2e6a5d86 drivers/isdn/gigaset/common.c: Remove useless kfree
Remove useless kfree() and clean up code related to the removal.

The semantic patch that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
position p1,p2;
expression x;
@@

if (x@p1 == NULL) { ... kfree@p2(x); ... return ...; }

@unchanged exists@
position r.p1,r.p2;
expression e <= r.x,x,e1;
iterator I;
statement S;
@@

if (x@p1 == NULL) { ... when != I(x,...) S
                        when != e = e1
                        when != e += e1
                        when != e -= e1
                        when != ++e
                        when != --e
                        when != e++
                        when != e--
                        when != &e
   kfree@p2(x); ... return ...; }

@ok depends on unchanged exists@
position any r.p1;
position r.p2;
expression x;
@@

... when != true x@p1 == NULL
kfree@p2(x);

@depends on !ok && unchanged@
position r.p2;
expression x;
@@

*kfree@p2(x);
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Acked-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-09-13 17:05:17 -04:00
..
asyncdata.c isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
bas-gigaset.c USB 3.5-rc1 pull request 2012-05-22 15:50:46 -07:00
capi.c gigaset: silence GCC warning for unused 'format_ie' 2012-07-16 23:23:53 -07:00
common.c drivers/isdn/gigaset/common.c: Remove useless kfree 2012-09-13 17:05:17 -04:00
dummyll.c isdn/gigaset: unify function return values 2012-05-07 22:37:56 -04:00
ev-layer.c isdn/gigaset: unify function return values 2012-05-07 22:37:56 -04:00
gigaset.h isdn/gigaset: unify function return values 2012-05-07 22:37:56 -04:00
i4l.c isdn/gigaset: unify function return values 2012-05-07 22:37:56 -04:00
interface.c isdn/gigaset: use gig_dbg() for debugging output 2012-04-09 10:30:38 -07:00
isocdata.c isdn/gigaset: unify function return values 2012-05-07 22:37:56 -04:00
Kconfig isdn/gigaset: remove EXPERIMENTAL tag from GIGASET_CAPI 2010-07-07 16:57:56 -07:00
Makefile gigaset: add Kernel CAPI interface (v3) 2009-10-06 22:43:53 -07:00
proc.c isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
ser-gigaset.c isdn/gigaset: unify function return values 2012-05-07 22:37:56 -04:00
usb-gigaset.c USB 3.5-rc1 pull request 2012-05-22 15:50:46 -07:00