PCI: Constify bin_attribute structures
authorBhumika Goyal <bhumirks@gmail.com>
Wed, 2 Aug 2017 15:27:27 +0000 (20:57 +0530)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 10 Aug 2017 20:21:42 +0000 (15:21 -0500)
Add const to bin_attribute structures as they are only passed to the
functions sysfs_{remove/create}_bin_file. The corresponding arguments are
of type const, so declare the structures to be const.

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

index 2eed0dc..93e7b97 100644 (file)
@@ -1431,7 +1431,7 @@ static ssize_t pci_read_rom(struct file *filp, struct kobject *kobj,
        return count;
 }
 
-static struct bin_attribute pci_config_attr = {
+static const struct bin_attribute pci_config_attr = {
        .attr = {
                .name = "config",
                .mode = S_IRUGO | S_IWUSR,
@@ -1441,7 +1441,7 @@ static struct bin_attribute pci_config_attr = {
        .write = pci_write_config,
 };
 
-static struct bin_attribute pcie_config_attr = {
+static const struct bin_attribute pcie_config_attr = {
        .attr = {
                .name = "config",
                .mode = S_IRUGO | S_IWUSR,