aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMegan Kamiya <megan.a.kamiya@intel.com>2014-09-05 23:19:10 -0400
committerBjorn Helgaas <bhelgaas@google.com>2014-09-16 19:09:09 -0400
commit63ddc0b8fe5ebbac88e2ac84b489470bf3a22965 (patch)
tree34ffa6316d46ec8510838e6090213d6f5ffedc6d /include/linux
parent9fe373f9997b48fcd6222b95baf4a20c134b587a (diff)
PCI: Parenthesize PCI_DEVID and PCI_VPD_LRDT_ID parameters
Add parentheses around parameters in PCI_DEVID and PCI_VPD_LRDT_ID macros to prevent possible expansion errors as described by the CERT Secure Coding Standard: PRE01-C: Use parentheses within macros around parameter names Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Megan Kamiya <megan.a.kamiya@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pci.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 61978a460841..cb744f3925a4 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -45,7 +45,7 @@
45 * In the interest of not exposing interfaces to user-space unnecessarily, 45 * In the interest of not exposing interfaces to user-space unnecessarily,
46 * the following kernel-only defines are being added here. 46 * the following kernel-only defines are being added here.
47 */ 47 */
48#define PCI_DEVID(bus, devfn) ((((u16)bus) << 8) | devfn) 48#define PCI_DEVID(bus, devfn) ((((u16)(bus)) << 8) | (devfn))
49/* return bus from PCI devid = ((u16)bus_number) << 8) | devfn */ 49/* return bus from PCI devid = ((u16)bus_number) << 8) | devfn */
50#define PCI_BUS_NUM(x) (((x) >> 8) & 0xff) 50#define PCI_BUS_NUM(x) (((x) >> 8) & 0xff)
51 51
@@ -1701,7 +1701,7 @@ bool pci_acs_path_enabled(struct pci_dev *start,
1701 struct pci_dev *end, u16 acs_flags); 1701 struct pci_dev *end, u16 acs_flags);
1702 1702
1703#define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */ 1703#define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */
1704#define PCI_VPD_LRDT_ID(x) (x | PCI_VPD_LRDT) 1704#define PCI_VPD_LRDT_ID(x) ((x) | PCI_VPD_LRDT)
1705 1705
1706/* Large Resource Data Type Tag Item Names */ 1706/* Large Resource Data Type Tag Item Names */
1707#define PCI_VPD_LTIN_ID_STRING 0x02 /* Identifier String */ 1707#define PCI_VPD_LTIN_ID_STRING 0x02 /* Identifier String */