diff options
author | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2023-10-18 14:32:50 +0300 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2023-10-24 10:54:04 -0500 |
commit | abaaac4845a0d6f39f83cbaba4c3b46ba5f93170 (patch) | |
tree | d88cbbcaed4b22bf9e6789b47123a6dc8ab33137 /drivers/pci/hotplug/pnv_php.c | |
parent | 92af77ca26f75f7874634c8ac2f744f86ec56e88 (diff) |
PCI: hotplug: Use FIELD_GET/PREP()
Instead of handcrafted shifts to handle register fields, use
FIELD_GET/FIELD_PREP().
Link: https://lore.kernel.org/r/20231018113254.17616-4-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/hotplug/pnv_php.c')
-rw-r--r-- | drivers/pci/hotplug/pnv_php.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 881d420637bf..694349be9d0a 100644 --- a/drivers/pci/hotplug/pnv_php.c +++ b/drivers/pci/hotplug/pnv_php.c @@ -5,6 +5,7 @@ * Copyright Gavin Shan, IBM Corporation 2016. */ +#include <linux/bitfield.h> #include <linux/libfdt.h> #include <linux/module.h> #include <linux/pci.h> @@ -731,7 +732,7 @@ static int pnv_php_enable_msix(struct pnv_php_slot *php_slot) /* Check hotplug MSIx entry is in range */ pcie_capability_read_word(pdev, PCI_EXP_FLAGS, &pcie_flag); - entry.entry = (pcie_flag & PCI_EXP_FLAGS_IRQ) >> 9; + entry.entry = FIELD_GET(PCI_EXP_FLAGS_IRQ, pcie_flag); if (entry.entry >= nr_entries) return -ERANGE; |