Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dasd: remove dead code

Since e443343e509a we haven't had a request_fn attached to
this driver, hence any code inside an if (q->request_fn) is
unreachable.

Fixes: e443343e509a ("s390/dasd: blk-mq conversion")
[sth: Keep and fix the dasd_info->chanq_len counter.]
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Tested-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

+5 -17
+5 -17
drivers/s390/block/dasd_ioctl.c
··· 412 412 struct ccw_dev_id dev_id; 413 413 struct dasd_device *base; 414 414 struct ccw_device *cdev; 415 + struct list_head *l; 415 416 unsigned long flags; 416 417 int rc; 417 418 ··· 463 462 464 463 memcpy(dasd_info->type, base->discipline->name, 4); 465 464 466 - if (block->request_queue->request_fn) { 467 - struct list_head *l; 468 - #ifdef DASD_EXTENDED_PROFILING 469 - { 470 - struct list_head *l; 471 - spin_lock_irqsave(&block->lock, flags); 472 - list_for_each(l, &block->request_queue->queue_head) 473 - dasd_info->req_queue_len++; 474 - spin_unlock_irqrestore(&block->lock, flags); 475 - } 476 - #endif /* DASD_EXTENDED_PROFILING */ 477 - spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags); 478 - list_for_each(l, &base->ccw_queue) 479 - dasd_info->chanq_len++; 480 - spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), 481 - flags); 482 - } 465 + spin_lock_irqsave(&block->queue_lock, flags); 466 + list_for_each(l, &base->ccw_queue) 467 + dasd_info->chanq_len++; 468 + spin_unlock_irqrestore(&block->queue_lock, flags); 483 469 484 470 rc = 0; 485 471 if (copy_to_user(argp, dasd_info,