Skip to content

Commit ec302b1

Browse files
committed
PCI/PME: Use FIELD_GET()
Use FIELD_GET() to remove dependences on the field position, i.e., the shift value. No functional change intended. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]>
1 parent e0701bd commit ec302b1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

drivers/pci/pcie/pme.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#define dev_fmt(fmt) "PME: " fmt
1111

12+
#include <linux/bitfield.h>
1213
#include <linux/pci.h>
1314
#include <linux/kernel.h>
1415
#include <linux/errno.h>
@@ -235,7 +236,8 @@ static void pcie_pme_work_fn(struct work_struct *work)
235236
pcie_clear_root_pme_status(port);
236237

237238
spin_unlock_irq(&data->lock);
238-
pcie_pme_handle_request(port, rtsta & 0xffff);
239+
pcie_pme_handle_request(port,
240+
FIELD_GET(PCI_EXP_RTSTA_PME_RQ_ID, rtsta));
239241
spin_lock_irq(&data->lock);
240242

241243
continue;

include/uapi/linux/pci_regs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@
637637
#define PCI_EXP_RTCAP 0x1e /* Root Capabilities */
638638
#define PCI_EXP_RTCAP_CRSVIS 0x0001 /* CRS Software Visibility capability */
639639
#define PCI_EXP_RTSTA 0x20 /* Root Status */
640+
#define PCI_EXP_RTSTA_PME_RQ_ID 0x0000ffff /* PME Requester ID */
640641
#define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */
641642
#define PCI_EXP_RTSTA_PENDING 0x00020000 /* PME pending */
642643
/*

0 commit comments

Comments
 (0)