]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
PCI: Constify pci_dev_type structure
authorBhumika Goyal <bhumirks@gmail.com>
Tue, 12 Sep 2017 11:13:33 +0000 (16:43 +0530)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 5 Oct 2017 20:53:31 +0000 (15:53 -0500)
Make this const as it not modified in the file referencing it.  It is only
stored in a const field 'type' of a device structure.  Also, add const to
the variable declaration in the header file.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci-sysfs.c
drivers/pci/pci.h

index 8e075ea2743ef41b4ed08065f502527cbe804c82..5aa81ad91a885f1d26ac77bfae3895b04ea46146 100644 (file)
@@ -1795,6 +1795,6 @@ static const struct attribute_group *pci_dev_attr_groups[] = {
        NULL,
 };
 
-struct device_type pci_dev_type = {
+const struct device_type pci_dev_type = {
        .groups = pci_dev_attr_groups,
 };
index a6560c9baa52acb766ade748a0473cf74af6cd77..1db36f2e1ef59986443b2ee212c6e7eb9d85e5a9 100644 (file)
@@ -192,7 +192,7 @@ static inline int pci_no_d1d2(struct pci_dev *dev)
 }
 extern const struct attribute_group *pci_dev_groups[];
 extern const struct attribute_group *pcibus_groups[];
-extern struct device_type pci_dev_type;
+extern const struct device_type pci_dev_type;
 extern const struct attribute_group *pci_bus_groups[];