@@ -512,7 +512,7 @@ static void pmu_sbi_set_scounteren(void *arg)
512
512
513
513
if (event -> hw .idx != -1 )
514
514
csr_write (CSR_SCOUNTEREN ,
515
- csr_read (CSR_SCOUNTEREN ) | ( 1 << pmu_sbi_csr_index (event )));
515
+ csr_read (CSR_SCOUNTEREN ) | BIT ( pmu_sbi_csr_index (event )));
516
516
}
517
517
518
518
static void pmu_sbi_reset_scounteren (void * arg )
@@ -521,7 +521,7 @@ static void pmu_sbi_reset_scounteren(void *arg)
521
521
522
522
if (event -> hw .idx != -1 )
523
523
csr_write (CSR_SCOUNTEREN ,
524
- csr_read (CSR_SCOUNTEREN ) & ~( 1 << pmu_sbi_csr_index (event )));
524
+ csr_read (CSR_SCOUNTEREN ) & ~BIT ( pmu_sbi_csr_index (event )));
525
525
}
526
526
527
527
static void pmu_sbi_ctr_start (struct perf_event * event , u64 ival )
@@ -731,14 +731,14 @@ static irqreturn_t pmu_sbi_ovf_handler(int irq, void *dev)
731
731
/* compute hardware counter index */
732
732
hidx = info -> csr - CSR_CYCLE ;
733
733
/* check if the corresponding bit is set in sscountovf */
734
- if (!(overflow & ( 1 << hidx )))
734
+ if (!(overflow & BIT ( hidx )))
735
735
continue ;
736
736
737
737
/*
738
738
* Keep a track of overflowed counters so that they can be started
739
739
* with updated initial value.
740
740
*/
741
- overflowed_ctrs |= 1 << lidx ;
741
+ overflowed_ctrs |= BIT ( lidx ) ;
742
742
hw_evt = & event -> hw ;
743
743
riscv_pmu_event_update (event );
744
744
perf_sample_data_init (& data , 0 , hw_evt -> last_period );
0 commit comments