powercap: DTPM: Avoid explicit cpumask allocation on stack
authorDawei Li <dawei.li@shingroup.cn>
Mon, 15 Apr 2024 09:48:21 +0000 (17:48 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 16 Apr 2024 11:33:03 +0000 (13:33 +0200)
commit0654acd8eb7de3d82d0e8dc0235f1c7a67577da4
treef855ccb17f84ce2de4cbcac1ca636d96e5de388e
parent0bbac3facb5d6cc0171c45c9873a2dc96bea9680
powercap: DTPM: Avoid explicit cpumask allocation on stack

In general it's preferable to avoid placing cpumasks on the stack, as
for large values of NR_CPUS these can consume significant amounts of
stack space and make stack overflows more likely.

Use cpumask_weight_and() to avoid the need for a temporary cpumask on
the stack.

Signed-off-by: Dawei Li <dawei.li@shingroup.cn>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/powercap/dtpm_cpu.c