]> git.baikalelectronics.ru Git - kernel.git/commit
perf: replace bitmap_weight with bitmap_empty where appropriate
authorYury Norov <yury.norov@gmail.com>
Thu, 10 Feb 2022 22:48:56 +0000 (14:48 -0800)
committerWill Deacon <will@kernel.org>
Tue, 15 Feb 2022 14:38:57 +0000 (14:38 +0000)
commitd3d3a652951bda1b8f163911fdee34a9e8aa15fd
tree868ab4d1a7d99ade05dc3729f5dc705d10387d87
parentf1c6f5227bdbab66ab9a8dc8ed06b60d4c89d9a3
perf: replace bitmap_weight with bitmap_empty where appropriate

In some places, drivers/perf 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>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20220210224933.379149-13-yury.norov@gmail.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm-cci.c
drivers/perf/arm_pmu.c
drivers/perf/hisilicon/hisi_uncore_pmu.c
drivers/perf/xgene_pmu.c