Skip to content

Commit

Permalink
perf/hw_breakpoint: Mark data __ro_after_init
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
melver authored and Peter Zijlstra committed Aug 30, 2022
1 parent 0370dc3 commit db5f6f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/events/hw_breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct bp_cpuinfo {
};

static DEFINE_PER_CPU(struct bp_cpuinfo, bp_cpuinfo[TYPE_MAX]);
static int nr_slots[TYPE_MAX];
static int nr_slots[TYPE_MAX] __ro_after_init;

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

static int constraints_initialized;
static bool constraints_initialized __ro_after_init;

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

constraints_initialized = 1;
constraints_initialized = true;

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

Expand Down

0 comments on commit db5f6f8

Please sign in to comment.