Skip to content

Commit 3ee1a6b

Browse files
ruanjinjie-engkwilczynski
authored andcommitted
PCI/AER: Use PCI_DEVID() macro in aer_inject()
The PCI_DEVID() macro can be used instead of open-coding it. No functional changes intended. Link: https://lore.kernel.org/linux-pci/20240829022435.4145181-1-ruanjinjie@huawei.com Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> [kwilczynski: commit log] Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
1 parent 8400291 commit 3ee1a6b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/pci/pcie/aer_inject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ static int aer_inject(struct aer_error_inj *einj)
430430
else
431431
rperr->root_status |= PCI_ERR_ROOT_COR_RCV;
432432
rperr->source_id &= 0xffff0000;
433-
rperr->source_id |= (einj->bus << 8) | devfn;
433+
rperr->source_id |= PCI_DEVID(einj->bus, devfn);
434434
}
435435
if (einj->uncor_status) {
436436
if (rperr->root_status & PCI_ERR_ROOT_UNCOR_RCV)
@@ -443,7 +443,7 @@ static int aer_inject(struct aer_error_inj *einj)
443443
rperr->root_status |= PCI_ERR_ROOT_NONFATAL_RCV;
444444
rperr->root_status |= PCI_ERR_ROOT_UNCOR_RCV;
445445
rperr->source_id &= 0x0000ffff;
446-
rperr->source_id |= ((einj->bus << 8) | devfn) << 16;
446+
rperr->source_id |= PCI_DEVID(einj->bus, devfn) << 16;
447447
}
448448
spin_unlock_irqrestore(&inject_lock, flags);
449449

0 commit comments

Comments
 (0)