Skip to content

Commit db5f6f8

Browse files
melverPeter Zijlstra
authored and
Peter Zijlstra
committed
perf/hw_breakpoint: Mark data __ro_after_init
Mark read-only data after initialization as __ro_after_init. While we are here, turn 'constraints_initialized' into a bool. Signed-off-by: Marco Elver <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Dmitry Vyukov <[email protected]> Acked-by: Ian Rogers <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 0370dc3 commit db5f6f8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/events/hw_breakpoint.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct bp_cpuinfo {
4646
};
4747

4848
static DEFINE_PER_CPU(struct bp_cpuinfo, bp_cpuinfo[TYPE_MAX]);
49-
static int nr_slots[TYPE_MAX];
49+
static int nr_slots[TYPE_MAX] __ro_after_init;
5050

5151
static struct bp_cpuinfo *get_bp_info(int cpu, enum bp_type_idx type)
5252
{
@@ -62,7 +62,7 @@ static const struct rhashtable_params task_bps_ht_params = {
6262
.automatic_shrinking = true,
6363
};
6464

65-
static int constraints_initialized;
65+
static bool constraints_initialized __ro_after_init;
6666

6767
/* Gather the number of total pinned and un-pinned bp in a cpuset */
6868
struct bp_busy_slots {
@@ -739,7 +739,7 @@ int __init init_hw_breakpoint(void)
739739
if (ret)
740740
goto err;
741741

742-
constraints_initialized = 1;
742+
constraints_initialized = true;
743743

744744
perf_pmu_register(&perf_breakpoint, "breakpoint", PERF_TYPE_BREAKPOINT);
745745

0 commit comments

Comments
 (0)