From: Bhumika Goyal <bhumirks@gmail.com>
To: julia.lawall@lip6.fr, bhelgaas@google.com,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Bhumika Goyal <bhumirks@gmail.com>
Subject: [PATCH] PCI: make pci_dev_type const
Date: Tue, 12 Sep 2017 16:43:33 +0530 [thread overview]
Message-ID: <1505214813-9591-1-git-send-email-bhumirks@gmail.com> (raw)
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>
---
drivers/pci/pci-sysfs.c | 2 +-
drivers/pci/pci.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 1eecfa3..882d6c3 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -1788,6 +1788,6 @@ static umode_t sriov_attrs_are_visible(struct kobject *kobj,
NULL,
};
-struct device_type pci_dev_type = {
+const struct device_type pci_dev_type = {
.groups = pci_dev_attr_groups,
};
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index a6560c9..1db36f2 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -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[];
--
1.9.1
next reply other threads:[~2017-09-12 11:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-12 11:13 Bhumika Goyal [this message]
2017-09-19 19:44 ` [PATCH] PCI: make pci_dev_type const Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1505214813-9591-1-git-send-email-bhumirks@gmail.com \
--to=bhumirks@gmail.com \
--cc=bhelgaas@google.com \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).