dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/block
Peter Senna Tschudin d41570b746 block/blk-tag.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>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2012-09-12 22:25:12 +02:00
..
partitions s390/dasd: re-prioritize partition detection message 2012-05-16 14:42:51 +02:00
Kconfig move fs/partitions to block/ 2012-01-03 22:54:06 -05:00
Kconfig.iosched blkcg: make CONFIG_BLK_CGROUP bool 2012-03-06 21:27:21 +01:00
Makefile separate partition format handling from generic code 2012-01-03 22:54:06 -05:00
blk-cgroup.c blkcg: implement per-blkg request allocation 2012-06-26 18:42:49 -04:00
blk-cgroup.h blkcg: implement per-blkg request allocation 2012-06-26 18:42:49 -04:00
blk-core.c block: remove the duplicated setting for congestion_threshold 2012-09-09 12:44:10 +02:00
blk-exec.c [SCSI] block: Fix blk_execute_rq_nowait() dead queue handling 2012-07-20 08:58:39 +01:00
blk-flush.c blk-flush: move the queue kick into 2011-10-24 16:24:31 +02:00
blk-integrity.c block: add export.h to files using EXPORT_SYMBOL/THIS_MODULE macros 2011-10-31 19:31:12 -04:00
blk-ioc.c block: uninitialized ioc->nr_tasks triggers WARN_ON 2012-08-01 12:17:27 +02:00
blk-iopoll.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
blk-lib.c block: split discard into aligned requests 2012-08-02 09:48:50 +02:00
blk-map.c block: re-use existing 'reading' variable instead of checking direction again 2011-12-21 15:27:24 +01:00
blk-merge.c block: Add blk_bio_map_sg() helper 2012-08-02 23:42:04 +02:00
blk-settings.c block: do not artificially constrain max_sectors for stacking drivers 2012-08-01 10:44:28 +02:00
blk-softirq.c sched, block: Unify cache detection 2012-01-27 13:28:48 +01:00
blk-sysfs.c block: reject invalid queue attribute values 2012-09-09 10:39:18 +02:00
blk-tag.c block/blk-tag.c: Remove useless kfree 2012-09-12 22:25:12 +02:00
blk-throttle.c block: allocate io_context upfront 2012-06-25 11:53:50 +02:00
blk-timeout.c block: Drop dead function blk_abort_queue() 2012-06-15 08:46:23 +02:00
blk.h block: remove dead func declaration 2012-08-01 12:25:54 +02:00
bsg-lib.c block: drop custom queue draining used by scsi_transport_{iscsi|fc} 2012-06-25 11:53:48 +02:00
bsg.c bsg: fix sysfs link remove warning 2012-02-08 20:02:03 +01:00
cfq-iosched.c block: blkcg_policy_cfq shouldn't be used if !CONFIG_CFQ_GROUP_IOSCHED 2012-06-04 10:02:29 +02:00
compat_ioctl.c block: Add BLKROTATIONAL ioctl 2012-01-11 16:29:31 +01:00
deadline-iosched.c elevator: make elevator_init_fn() return 0/-errno 2012-03-06 21:27:21 +01:00
elevator.c blkcg: implement per-queue policy activation 2012-04-20 10:06:06 +02:00
genhd.c block: Don't use static to define "void *p" in show_partition_start() 2012-08-03 10:42:00 +02:00
ioctl.c block: add partition resize function to blkpg ioctl 2012-08-01 12:24:18 +02:00
noop-iosched.c elevator: make elevator_init_fn() return 0/-errno 2012-03-06 21:27:21 +01:00
partition-generic.c block: add partition resize function to blkpg ioctl 2012-08-01 12:24:18 +02:00
scsi_ioctl.c scsi: Silence unnecessary warnings about ioctl to partition 2012-06-15 12:52:46 +02:00