aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/events/amd/iommu.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/x86/events/amd/iommu.c b/arch/x86/events/amd/iommu.c
index 8d8ed40613fa..e112f498a019 100644
--- a/arch/x86/events/amd/iommu.c
+++ b/arch/x86/events/amd/iommu.c
@@ -164,11 +164,11 @@ static int get_next_avail_iommu_bnk_cntr(struct perf_amd_iommu *perf_iommu)
164 for (bank = 0, shift = 0; bank < max_banks; bank++) { 164 for (bank = 0, shift = 0; bank < max_banks; bank++) {
165 for (cntr = 0; cntr < max_cntrs; cntr++) { 165 for (cntr = 0; cntr < max_cntrs; cntr++) {
166 shift = bank + (bank*3) + cntr; 166 shift = bank + (bank*3) + cntr;
167 if (perf_iommu->cntr_assign_mask & (1ULL<<shift)) { 167 if (perf_iommu->cntr_assign_mask & BIT_ULL(shift)) {
168 continue; 168 continue;
169 } else { 169 } else {
170 perf_iommu->cntr_assign_mask |= (1ULL<<shift); 170 perf_iommu->cntr_assign_mask |= BIT_ULL(shift);
171 retval = ((u16)((u16)bank<<8) | (u8)(cntr)); 171 retval = ((bank & 0xFF) << 8) | (cntr & 0xFF);
172 goto out; 172 goto out;
173 } 173 }
174 } 174 }
@@ -265,23 +265,23 @@ static void perf_iommu_enable_event(struct perf_event *ev)
265 _GET_BANK(ev), _GET_CNTR(ev) , 265 _GET_BANK(ev), _GET_CNTR(ev) ,
266 IOMMU_PC_COUNTER_SRC_REG, &reg, true); 266 IOMMU_PC_COUNTER_SRC_REG, &reg, true);
267 267
268 reg = 0ULL | devid | (_GET_DEVID_MASK(ev) << 32); 268 reg = devid | (_GET_DEVID_MASK(ev) << 32);
269 if (reg) 269 if (reg)
270 reg |= (1UL << 31); 270 reg |= BIT(31);
271 amd_iommu_pc_get_set_reg_val(devid, 271 amd_iommu_pc_get_set_reg_val(devid,
272 _GET_BANK(ev), _GET_CNTR(ev) , 272 _GET_BANK(ev), _GET_CNTR(ev) ,
273 IOMMU_PC_DEVID_MATCH_REG, &reg, true); 273 IOMMU_PC_DEVID_MATCH_REG, &reg, true);
274 274
275 reg = 0ULL | _GET_PASID(ev) | (_GET_PASID_MASK(ev) << 32); 275 reg = _GET_PASID(ev) | (_GET_PASID_MASK(ev) << 32);
276 if (reg) 276 if (reg)
277 reg |= (1UL << 31); 277 reg |= BIT(31);
278 amd_iommu_pc_get_set_reg_val(devid, 278 amd_iommu_pc_get_set_reg_val(devid,
279 _GET_BANK(ev), _GET_CNTR(ev) , 279 _GET_BANK(ev), _GET_CNTR(ev) ,
280 IOMMU_PC_PASID_MATCH_REG, &reg, true); 280 IOMMU_PC_PASID_MATCH_REG, &reg, true);
281 281
282 reg = 0ULL | _GET_DOMID(ev) | (_GET_DOMID_MASK(ev) << 32); 282 reg = _GET_DOMID(ev) | (_GET_DOMID_MASK(ev) << 32);
283 if (reg) 283 if (reg)
284 reg |= (1UL << 31); 284 reg |= BIT(31);
285 amd_iommu_pc_get_set_reg_val(devid, 285 amd_iommu_pc_get_set_reg_val(devid,
286 _GET_BANK(ev), _GET_CNTR(ev) , 286 _GET_BANK(ev), _GET_CNTR(ev) ,
287 IOMMU_PC_DOMID_MATCH_REG, &reg, true); 287 IOMMU_PC_DOMID_MATCH_REG, &reg, true);