Julia Lawall
3f3420df50
Btrfs: fs/btrfs/volumes.c: remove useless kzalloc
...
The call to kzalloc is followed by a kmalloc whose result is stored in the
same variable.
The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/ )
// <smpl>
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,l;
position p1,p2;
expression *ptr != NULL;
@@
(
if ((x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...)) == NULL) S
|
x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
)
<... when != x
when != if (...) { <+...x...+> }
x->f = E
...>
(
return \(0\|<+...x...+>\|ptr\);
|
return@p2 ...;
)
@script:python@
p1 << r.p1;
p2 << r.p2;
@@
print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk >
Signed-off-by: Chris Mason <chris.mason@oracle.com >
2009-02-12 10:16:03 -05:00
..
2009-01-22 13:16:01 +03:00
2009-01-22 13:15:56 +03:00
2009-01-22 13:15:56 +03:00
2009-01-22 13:16:01 +03:00
2009-01-22 13:15:54 +03:00
2009-01-22 13:15:54 +03:00
2009-01-22 13:15:57 +03:00
2009-01-22 13:15:57 +03:00
2009-02-12 10:16:03 -05:00
2009-01-05 18:32:06 -08:00
2009-01-22 13:16:01 +03:00
2009-01-22 13:15:56 +03:00
2009-01-22 13:15:58 +03:00
2009-01-07 10:00:16 -08:00
2009-01-05 11:54:28 -05:00
2009-01-21 15:28:45 -06:00
2009-01-22 13:15:56 +03:00
2009-01-22 13:15:57 +03:00
2008-12-25 11:40:09 +11:00
2009-01-15 16:39:42 -08:00
2009-01-09 16:54:42 -08:00
2009-01-09 16:54:42 -08:00
2009-01-22 13:15:55 +03:00
2009-01-22 13:15:58 +03:00
2009-01-26 10:08:50 -08:00
2009-01-09 16:54:42 -08:00
2009-01-22 13:15:57 +03:00
2009-01-22 13:15:57 +03:00
2009-01-04 13:33:20 -08:00
2009-01-22 13:15:59 +03:00
2008-11-14 10:39:25 +11:00
2009-01-06 15:59:08 -08:00
2009-01-22 13:15:55 +03:00
2009-01-08 08:31:01 -08:00
2009-01-08 17:14:59 -08:00
2009-01-09 21:05:21 +00:00
2009-01-22 13:15:54 +03:00
2009-01-07 15:40:44 -05:00
2009-01-22 13:15:58 +03:00
2009-01-22 13:16:01 +03:00
2009-01-22 13:16:00 +03:00
2008-12-23 15:21:32 -05:00
2009-01-27 17:26:59 -05:00
2008-10-17 02:38:36 +11:00
2009-01-26 10:08:05 -08:00
2009-01-22 13:15:55 +03:00
2009-01-26 10:41:00 -08:00
2009-01-22 13:15:58 +03:00
2009-01-05 11:54:28 -05:00
2009-01-09 21:46:13 +01:00
2009-01-09 14:00:58 -08:00
2009-01-22 13:15:59 +03:00
2009-01-08 12:04:46 +00:00
2009-01-22 13:15:53 +03:00
2009-01-22 13:15:59 +03:00
2009-01-22 13:16:01 +03:00
2009-01-22 13:15:58 +03:00
2009-01-26 10:40:28 -08:00
2009-01-22 13:15:59 +03:00
2009-01-07 11:31:52 -08:00
2009-01-22 13:15:55 +03:00
2009-01-22 13:16:00 +03:00
2009-01-22 01:23:11 -06:00
2009-01-14 14:15:25 +01:00
2008-12-31 16:55:44 +02:00
2008-11-14 10:39:05 +11:00
2008-12-31 18:07:43 -05:00
2009-01-03 11:45:54 -08:00
2009-01-08 12:04:47 +00:00
2009-01-08 08:31:12 -08:00
2008-10-16 11:21:38 -07:00
2009-01-08 12:04:47 +00:00
2009-01-06 15:59:19 -08:00
2008-10-16 11:21:38 -07:00
2008-11-14 10:39:24 +11:00
2008-12-29 08:29:23 +01:00
2009-01-02 11:10:35 -06:00
2009-01-09 16:54:42 -08:00
2009-01-14 14:15:22 +01:00
2009-01-06 15:59:13 -08:00
2008-07-25 10:53:34 -07:00
2009-01-14 14:15:16 +01:00
2009-01-14 14:15:26 +01:00
2009-01-14 14:15:18 +01:00
2009-01-06 15:59:06 -08:00
2009-01-16 18:02:10 +01:00
2009-01-14 14:15:31 +01:00
2009-01-14 14:15:28 +01:00
2009-01-14 14:15:29 +01:00
2009-01-14 14:15:24 +01:00
2008-10-21 07:47:06 -04:00
2008-12-31 18:07:42 -05:00
2008-08-01 11:25:23 -04:00
2009-01-14 14:15:29 +01:00
2009-01-06 15:59:09 -08:00
2009-01-09 13:15:49 -08:00
2008-11-14 10:39:24 +11:00
2009-01-14 14:15:24 +01:00
2009-01-14 14:15:30 +01:00
2009-01-22 13:16:01 +03:00
2009-01-09 16:54:41 -08:00
2009-01-05 18:32:06 -08:00
2009-01-14 14:15:25 +01:00
2009-01-09 15:18:49 -08:00
2009-01-06 15:59:01 -08:00
2009-01-14 14:15:30 +01:00
2009-01-14 14:15:24 +01:00
2009-01-14 14:15:29 +01:00
2009-01-14 14:15:30 +01:00
2009-01-14 14:15:32 +01:00
2008-11-14 10:39:05 +11:00
2009-01-05 08:40:21 -08:00
2009-01-05 08:40:21 -08:00
2009-01-05 08:36:58 -08:00
2009-01-05 08:40:21 -08:00
2009-01-14 14:15:26 +01:00
2009-01-05 08:36:58 -08:00
2009-01-05 08:40:21 -08:00
2009-01-14 14:15:26 +01:00
2009-01-14 14:15:31 +01:00
2009-01-14 14:15:31 +01:00
2009-01-03 12:04:39 -08:00
2009-01-14 14:15:31 +01:00
2009-01-14 14:15:31 +01:00
2009-01-14 14:15:30 +01:00
2009-01-14 14:15:23 +01:00
2009-01-14 14:15:21 +01:00
2009-01-14 14:15:31 +01:00
2009-01-14 14:15:30 +01:00
2009-01-14 14:15:23 +01:00