diff mbox series

[-next,v2] PCI/AER: Use PCI_DEVID() macro to simplify the code

Message ID 20240829022435.4145181-1-ruanjinjie@huawei.com (mailing list archive)
State Accepted
Delegated to: Krzysztof Wilczyński
Headers show
Series [-next,v2] PCI/AER: Use PCI_DEVID() macro to simplify the code | expand

Commit Message

Jinjie Ruan Aug. 29, 2024, 2:24 a.m. UTC
The macro PCI_DEVID() can be used instead of compose it manually.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
v2:
- Add the missing space.
---
 drivers/pci/pcie/aer_inject.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Krzysztof Wilczyński Sept. 1, 2024, 5:13 p.m. UTC | #1
Hello,

> The macro PCI_DEVID() can be used instead of compose it manually.

Applied to aer, thank you!

[1/1] PCI/AER: Use PCI_DEVID() macro in aer_inject()
      https://git.kernel.org/pci/pci/c/3ee1a6b5d78f

	Krzysztof
diff mbox series

Patch

diff --git a/drivers/pci/pcie/aer_inject.c b/drivers/pci/pcie/aer_inject.c
index f81b2303bf6a..91acc7b17f68 100644
--- a/drivers/pci/pcie/aer_inject.c
+++ b/drivers/pci/pcie/aer_inject.c
@@ -430,7 +430,7 @@  static int aer_inject(struct aer_error_inj *einj)
 		else
 			rperr->root_status |= PCI_ERR_ROOT_COR_RCV;
 		rperr->source_id &= 0xffff0000;
-		rperr->source_id |= (einj->bus << 8) | devfn;
+		rperr->source_id |= PCI_DEVID(einj->bus, devfn);
 	}
 	if (einj->uncor_status) {
 		if (rperr->root_status & PCI_ERR_ROOT_UNCOR_RCV)
@@ -443,7 +443,7 @@  static int aer_inject(struct aer_error_inj *einj)
 			rperr->root_status |= PCI_ERR_ROOT_NONFATAL_RCV;
 		rperr->root_status |= PCI_ERR_ROOT_UNCOR_RCV;
 		rperr->source_id &= 0x0000ffff;
-		rperr->source_id |= ((einj->bus << 8) | devfn) << 16;
+		rperr->source_id |= PCI_DEVID(einj->bus, devfn) << 16;
 	}
 	spin_unlock_irqrestore(&inject_lock, flags);