File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -271,7 +271,7 @@ static void loongarch_pmu_enable_event(struct hw_perf_event *evt, int idx)
271271 WARN_ON (idx < 0 || idx >= loongarch_pmu .num_counters );
272272
273273 /* Make sure interrupt enabled. */
274- cpuc -> saved_ctrl [idx ] = M_PERFCTL_EVENT (evt -> event_base & 0xff ) |
274+ cpuc -> saved_ctrl [idx ] = M_PERFCTL_EVENT (evt -> event_base ) |
275275 (evt -> config_base & M_PERFCTL_CONFIG_MASK ) | CSR_PERFCTRL_IE ;
276276
277277 cpu = (event -> cpu >= 0 ) ? event -> cpu : smp_processor_id ();
@@ -594,7 +594,7 @@ static struct pmu pmu = {
594594
595595static unsigned int loongarch_pmu_perf_event_encode (const struct loongarch_perf_event * pev )
596596{
597- return (pev -> event_id & 0xff );
597+ return M_PERFCTL_EVENT (pev -> event_id );
598598}
599599
600600static const struct loongarch_perf_event * loongarch_pmu_map_general_event (int idx )
@@ -849,7 +849,7 @@ static void resume_local_counters(void)
849849
850850static const struct loongarch_perf_event * loongarch_pmu_map_raw_event (u64 config )
851851{
852- raw_event .event_id = config & 0xff ;
852+ raw_event .event_id = M_PERFCTL_EVENT ( config ) ;
853853
854854 return & raw_event ;
855855}
You can’t perform that action at this time.
0 commit comments