Skip to content

Commit 2a32309

Browse files
Jinjie Ruanjoergroedel
authored andcommitted
iommu/vt-d: Use PCI_DEVID() macro
The macro PCI_DEVID() can be used instead of compose it manually. Signed-off-by: Jinjie Ruan <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lu Baolu <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 621838c commit 2a32309

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ static void copied_context_tear_down(struct intel_iommu *iommu,
14521452

14531453
if (did_old < cap_ndoms(iommu->cap)) {
14541454
iommu->flush.flush_context(iommu, did_old,
1455-
(((u16)bus) << 8) | devfn,
1455+
PCI_DEVID(bus, devfn),
14561456
DMA_CCMD_MASK_NOBIT,
14571457
DMA_CCMD_DEVICE_INVL);
14581458
iommu->flush.flush_iotlb(iommu, did_old, 0, 0,
@@ -1473,7 +1473,7 @@ static void context_present_cache_flush(struct intel_iommu *iommu, u16 did,
14731473
{
14741474
if (cap_caching_mode(iommu->cap)) {
14751475
iommu->flush.flush_context(iommu, 0,
1476-
(((u16)bus) << 8) | devfn,
1476+
PCI_DEVID(bus, devfn),
14771477
DMA_CCMD_MASK_NOBIT,
14781478
DMA_CCMD_DEVICE_INVL);
14791479
iommu->flush.flush_iotlb(iommu, did, 0, 0, DMA_TLB_DSI_FLUSH);

drivers/iommu/intel/irq_remapping.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ static int set_ioapic_sid(struct irte *irte, int apic)
312312

313313
for (i = 0; i < MAX_IO_APICS; i++) {
314314
if (ir_ioapic[i].iommu && ir_ioapic[i].id == apic) {
315-
sid = (ir_ioapic[i].bus << 8) | ir_ioapic[i].devfn;
315+
sid = PCI_DEVID(ir_ioapic[i].bus, ir_ioapic[i].devfn);
316316
break;
317317
}
318318
}
@@ -337,7 +337,7 @@ static int set_hpet_sid(struct irte *irte, u8 id)
337337

338338
for (i = 0; i < MAX_HPET_TBS; i++) {
339339
if (ir_hpet[i].iommu && ir_hpet[i].id == id) {
340-
sid = (ir_hpet[i].bus << 8) | ir_hpet[i].devfn;
340+
sid = PCI_DEVID(ir_hpet[i].bus, ir_hpet[i].devfn);
341341
break;
342342
}
343343
}

drivers/iommu/intel/pasid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ devtlb_invalidation_with_pasid(struct intel_iommu *iommu,
220220
if (pci_dev_is_disconnected(to_pci_dev(dev)))
221221
return;
222222

223-
sid = info->bus << 8 | info->devfn;
223+
sid = PCI_DEVID(info->bus, info->devfn);
224224
qdep = info->ats_qdep;
225225
pfsid = info->pfsid;
226226

0 commit comments

Comments
 (0)