Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jinjie Ruan and committed by
Krzysztof Wilczyński
3ee1a6b5 8400291e

+2 -2
+2 -2
drivers/pci/pcie/aer_inject.c
··· 430 430 else 431 431 rperr->root_status |= PCI_ERR_ROOT_COR_RCV; 432 432 rperr->source_id &= 0xffff0000; 433 - rperr->source_id |= (einj->bus << 8) | devfn; 433 + rperr->source_id |= PCI_DEVID(einj->bus, devfn); 434 434 } 435 435 if (einj->uncor_status) { 436 436 if (rperr->root_status & PCI_ERR_ROOT_UNCOR_RCV) ··· 443 443 rperr->root_status |= PCI_ERR_ROOT_NONFATAL_RCV; 444 444 rperr->root_status |= PCI_ERR_ROOT_UNCOR_RCV; 445 445 rperr->source_id &= 0x0000ffff; 446 - rperr->source_id |= ((einj->bus << 8) | devfn) << 16; 446 + rperr->source_id |= PCI_DEVID(einj->bus, devfn) << 16; 447 447 } 448 448 spin_unlock_irqrestore(&inject_lock, flags); 449 449