Skip to content

Commit

Permalink
block, blk-sysfs: Use the variable directly instead of a function call
Browse files Browse the repository at this point in the history
In the function blk_register_queue(), var _dev_ is already assigned by
disk_to_dev().So use it directly instead of calling disk_to_dev() again.

Signed-off-by: Liu Yuan <[email protected]>

Modified by me to delete an empty line in the same function while
in there anyway.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
liuy authored and Jens Axboe committed Apr 13, 2011
1 parent f4af3c3 commit 80656b6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions block/blk-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,6 @@ int blk_register_queue(struct gendisk *disk)
{
int ret;
struct device *dev = disk_to_dev(disk);

struct request_queue *q = disk->queue;

if (WARN_ON(!q))
Expand All @@ -521,7 +520,7 @@ int blk_register_queue(struct gendisk *disk)
if (ret) {
kobject_uevent(&q->kobj, KOBJ_REMOVE);
kobject_del(&q->kobj);
blk_trace_remove_sysfs(disk_to_dev(disk));
blk_trace_remove_sysfs(dev);
kobject_put(&dev->kobj);
return ret;
}
Expand Down

0 comments on commit 80656b6

Please sign in to comment.