public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next v2] PCI/AER: Use PCI_DEVID() macro to simplify the code
@ 2024-08-29  2:24 Jinjie Ruan
  2024-09-01 17:13 ` Krzysztof Wilczyński
  0 siblings, 1 reply; 2+ messages in thread
From: Jinjie Ruan @ 2024-08-29  2:24 UTC (permalink / raw)
  To: bhelgaas, sathyanarayanan.kuppuswamy, linux-pci; +Cc: ruanjinjie

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(-)

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);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next v2] PCI/AER: Use PCI_DEVID() macro to simplify the code
  2024-08-29  2:24 [PATCH -next v2] PCI/AER: Use PCI_DEVID() macro to simplify the code Jinjie Ruan
@ 2024-09-01 17:13 ` Krzysztof Wilczyński
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Wilczyński @ 2024-09-01 17:13 UTC (permalink / raw)
  To: Jinjie Ruan; +Cc: bhelgaas, sathyanarayanan.kuppuswamy, linux-pci

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-01 17:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-29  2:24 [PATCH -next v2] PCI/AER: Use PCI_DEVID() macro to simplify the code Jinjie Ruan
2024-09-01 17:13 ` Krzysztof Wilczyński

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox