]> git.proxmox.com Git - mirror_qemu.git/commit - util/thread-pool.c
thread-pool: clean up thread_pool_completion_bh()
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 2 Apr 2015 16:39:22 +0000 (17:39 +0100)
committerKevin Wolf <kwolf@redhat.com>
Tue, 28 Apr 2015 13:36:09 +0000 (15:36 +0200)
commit1faa5bb73247339bf3d797433a9ade990ef0fb32
treea90709ca58f1e5bb1616a6dc0b9a7843ab9cbb87
parentd1a126c53ddc563b7b731cee013e0362f7a5f22f
thread-pool: clean up thread_pool_completion_bh()

This patch simplifies thread_pool_completion_bh().

The function first checks elem->state:

  if (elem->state != THREAD_DONE) {
      continue;
  }

It then goes on to check elem->state == THREAD_DONE although we already
know this must be the case.

The QLIST_REMOVE() is duplicated down both branches of an if-else
statement so that can be lifted out as well.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1427992762-10126-1-git-send-email-stefanha@redhat.com
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
thread-pool.c