Skip to content

Commit

Permalink
blkcg: drop local variable @q from blkg_destroy()
Browse files Browse the repository at this point in the history
blkg_destroy() caches @blkg->q in local variable @q.  While there are
two places which needs @blkg->q, only lockdep_assert_held() used the
local variable leading to unused local variable warning if lockdep is
configured out.  Drop the local variable and just use @blkg->q
directly.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Rakesh Iyer <rni@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Jun 6, 2012
1 parent 7b421d2 commit 27e1f9d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,9 @@ EXPORT_SYMBOL_GPL(blkg_lookup_create);

static void blkg_destroy(struct blkcg_gq *blkg)
{
struct request_queue *q = blkg->q;
struct blkcg *blkcg = blkg->blkcg;

lockdep_assert_held(q->queue_lock);
lockdep_assert_held(blkg->q->queue_lock);
lockdep_assert_held(&blkcg->lock);

/* Something wrong if we are trying to remove same group twice */
Expand Down

0 comments on commit 27e1f9d

Please sign in to comment.