]> git.karo-electronics.de Git - karo-tx-linux.git/commit
oprofile: perf: use NR_CPUS instead or nr_cpumask_bits for static array
authorWill Deacon <will.deacon@arm.com>
Fri, 8 Jun 2012 15:16:04 +0000 (16:16 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 4 Jul 2012 04:44:25 +0000 (05:44 +0100)
commit3b8a121217806b5fcc2127298c52c0b499cc687b
tree3e638edc204bc13e0e2c61733b4f6787df48eda6
parent150005159b95061c2029f5ae63ead47f4e8607c3
oprofile: perf: use NR_CPUS instead or nr_cpumask_bits for static array

commit e734568b675c985db2026848fefaac01c22977a5 upstream.

The OProfile perf backend uses a static array to keep track of the
perf events on the system. When compiling with CONFIG_CPUMASK_OFFSTACK=y
&& SMP, nr_cpumask_bits is not a compile-time constant and the build
will fail with:

oprofile_perf.c:28: error: variably modified 'perf_events' at file scope

This patch uses NR_CPUs instead of nr_cpumask_bits for the array
initialisation. If this causes space problems in the future, we can
always move to dynamic allocation for the events array.

Cc: Matt Fleming <matt@console-pimps.org>
Reported-by: Russell King - ARM Linux <linux@arm.linux.org.uk>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/oprofile/oprofile_perf.c