]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: replace bitmap_weight with bitmap_empty where appropriate
authorYury Norov <yury.norov@gmail.com>
Sun, 23 Jan 2022 18:38:37 +0000 (10:38 -0800)
committerYury Norov <yury.norov@gmail.com>
Mon, 2 May 2022 13:30:39 +0000 (06:30 -0700)
commit32acc02a2812c80b1ee8af1e24fd001efe5e0980
tree027caf20408aa920974542f09190a2e5d3367b7f
parent9b8415f62d798a055b5be9b097b677061cda6195
KVM: x86: replace bitmap_weight with bitmap_empty where appropriate

In some places kvm/hyperv.c code calls bitmap_weight() to check if any bit
of a given bitmap is set. It's better to use bitmap_empty() in that case
because bitmap_empty() stops traversing the bitmap as soon as it finds
first set bit, while bitmap_weight() counts all bits unconditionally.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
arch/x86/kvm/hyperv.c