File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 4
4
* Copyright (c) 2016, Intel Corporation.
5
5
*/
6
6
7
+ #include <linux/bitfield.h>
7
8
#include <linux/module.h>
8
9
#include <linux/init.h>
9
10
#include <linux/pci.h>
@@ -53,7 +54,7 @@ void pci_ptm_init(struct pci_dev *dev)
53
54
pci_add_ext_cap_save_buffer (dev , PCI_EXT_CAP_ID_PTM , sizeof (u32 ));
54
55
55
56
pci_read_config_dword (dev , ptm + PCI_PTM_CAP , & cap );
56
- dev -> ptm_granularity = ( cap & PCI_PTM_GRANULARITY_MASK ) >> 8 ;
57
+ dev -> ptm_granularity = FIELD_GET ( PCI_PTM_GRANULARITY_MASK , cap ) ;
57
58
58
59
/*
59
60
* Per the spec recommendation (PCIe r6.0, sec 7.9.15.3), select the
@@ -146,7 +147,7 @@ static int __pci_enable_ptm(struct pci_dev *dev)
146
147
147
148
ctrl |= PCI_PTM_CTRL_ENABLE ;
148
149
ctrl &= ~PCI_PTM_GRANULARITY_MASK ;
149
- ctrl |= dev -> ptm_granularity << 8 ;
150
+ ctrl |= FIELD_PREP ( PCI_PTM_GRANULARITY_MASK , dev -> ptm_granularity ) ;
150
151
if (dev -> ptm_root )
151
152
ctrl |= PCI_PTM_CTRL_ROOT ;
152
153
You can’t perform that action at this time.
0 commit comments