Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1703294 > unrolled thread
| Started by | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| First post | 2017-08-03 19:20 +0200 |
| Last post | 2017-08-04 01:30 +0200 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 0/5] constify hotplug pci_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-03 19:20 +0200
[PATCH 1/5] PCI: hotplug: shpchp: constify pci_device_id. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-03 19:20 +0200
[PATCH 3/5] PCI: hotplug: bmphp_ebda: constify pci_device_id. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-03 19:20 +0200
Re: [PATCH 0/5] constify hotplug pci_device_id Bjorn Helgaas <helgaas@kernel.org> - 2017-08-04 01:00 +0200
Re: [PATCH 0/5] constify hotplug pci_device_id Bjorn Helgaas <helgaas@kernel.org> - 2017-08-04 01:30 +0200
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-08-03 19:20 +0200 |
| Subject | [PATCH 0/5] constify hotplug pci_device_id |
| Message-ID | <uarWW-37e-5@gated-at.bofh.it> |
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by <linux/pci.h> work with const pci_device_id. So mark the non-const structs as const. Arvind Yadav (5): [PATCH 1/5] PCI: hotplug: shpchp: constify pci_device_id. [PATCH 2/5] PCI: hotplug: ibmphp: constify pci_device_id. [PATCH 3/5] PCI: hotplug: bmphp_ebda: constify pci_device_id. [PATCH 4/5] PCI: hotplug: cpcihp_zt5550: constify pci_device_id. [PATCH 5/5] PCI: hotplug: cpqphp: constify pci_device_id. drivers/pci/hotplug/cpcihp_zt5550.c | 2 +- drivers/pci/hotplug/cpqphp_core.c | 2 +- drivers/pci/hotplug/ibmphp_core.c | 2 +- drivers/pci/hotplug/ibmphp_ebda.c | 2 +- drivers/pci/hotplug/shpchp_core.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) -- 2.7.4
[toc] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-08-03 19:20 +0200 |
| Subject | [PATCH 1/5] PCI: hotplug: shpchp: constify pci_device_id. |
| Message-ID | <uarWX-37e-33@gated-at.bofh.it> |
| In reply to | #1703294 |
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/pci/hotplug/shpchp_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
index 3454dc7..7bfb87b 100644
--- a/drivers/pci/hotplug/shpchp_core.c
+++ b/drivers/pci/hotplug/shpchp_core.c
@@ -351,7 +351,7 @@ static void shpc_remove(struct pci_dev *dev)
kfree(ctrl);
}
-static struct pci_device_id shpcd_pci_tbl[] = {
+static const struct pci_device_id shpcd_pci_tbl[] = {
{PCI_DEVICE_CLASS(((PCI_CLASS_BRIDGE_PCI << 8) | 0x00), ~0)},
{ /* end: all zeroes */ }
};
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-08-03 19:20 +0200 |
| Subject | [PATCH 3/5] PCI: hotplug: bmphp_ebda: constify pci_device_id. |
| Message-ID | <uarWX-37e-45@gated-at.bofh.it> |
| In reply to | #1703294 |
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/pci/hotplug/ibmphp_ebda.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c
index 43e345a..a6a4dac 100644
--- a/drivers/pci/hotplug/ibmphp_ebda.c
+++ b/drivers/pci/hotplug/ibmphp_ebda.c
@@ -1153,7 +1153,7 @@ void ibmphp_free_ebda_pci_rsrc_queue(void)
}
}
-static struct pci_device_id id_table[] = {
+static const struct pci_device_id id_table[] = {
{
.vendor = PCI_VENDOR_ID_IBM,
.device = HPC_DEVICE_ID,
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Bjorn Helgaas <helgaas@kernel.org> |
|---|---|
| Date | 2017-08-04 01:00 +0200 |
| Message-ID | <uaxfY-6D6-9@gated-at.bofh.it> |
| In reply to | #1703294 |
On Thu, Aug 03, 2017 at 10:39:11PM +0530, Arvind Yadav wrote: > pci_device_id are not supposed to change at runtime. All functions > working with pci_device_id provided by <linux/pci.h> work with > const pci_device_id. So mark the non-const structs as const. > > Arvind Yadav (5): > [PATCH 1/5] PCI: hotplug: shpchp: constify pci_device_id. > [PATCH 2/5] PCI: hotplug: ibmphp: constify pci_device_id. > [PATCH 3/5] PCI: hotplug: bmphp_ebda: constify pci_device_id. > [PATCH 4/5] PCI: hotplug: cpcihp_zt5550: constify pci_device_id. > [PATCH 5/5] PCI: hotplug: cpqphp: constify pci_device_id. > > drivers/pci/hotplug/cpcihp_zt5550.c | 2 +- > drivers/pci/hotplug/cpqphp_core.c | 2 +- > drivers/pci/hotplug/ibmphp_core.c | 2 +- > drivers/pci/hotplug/ibmphp_ebda.c | 2 +- > drivers/pci/hotplug/shpchp_core.c | 2 +- > 5 files changed, 5 insertions(+), 5 deletions(-) Applied to pci/hotplug for v4.14, thanks! I squashed these all into one patch since they all do the same thing and are so trivial.
[toc] | [prev] | [next] | [standalone]
| From | Bjorn Helgaas <helgaas@kernel.org> |
|---|---|
| Date | 2017-08-04 01:30 +0200 |
| Message-ID | <uaxJ0-76G-25@gated-at.bofh.it> |
| In reply to | #1703494 |
On Thu, Aug 03, 2017 at 05:57:49PM -0500, Bjorn Helgaas wrote: > On Thu, Aug 03, 2017 at 10:39:11PM +0530, Arvind Yadav wrote: > > pci_device_id are not supposed to change at runtime. All functions > > working with pci_device_id provided by <linux/pci.h> work with > > const pci_device_id. So mark the non-const structs as const. > > > > Arvind Yadav (5): > > [PATCH 1/5] PCI: hotplug: shpchp: constify pci_device_id. > > [PATCH 2/5] PCI: hotplug: ibmphp: constify pci_device_id. > > [PATCH 3/5] PCI: hotplug: bmphp_ebda: constify pci_device_id. > > [PATCH 4/5] PCI: hotplug: cpcihp_zt5550: constify pci_device_id. > > [PATCH 5/5] PCI: hotplug: cpqphp: constify pci_device_id. > > > > drivers/pci/hotplug/cpcihp_zt5550.c | 2 +- > > drivers/pci/hotplug/cpqphp_core.c | 2 +- > > drivers/pci/hotplug/ibmphp_core.c | 2 +- > > drivers/pci/hotplug/ibmphp_ebda.c | 2 +- > > drivers/pci/hotplug/shpchp_core.c | 2 +- > > 5 files changed, 5 insertions(+), 5 deletions(-) > > Applied to pci/hotplug for v4.14, thanks! I moved this to pci/misc along with the other constify patches.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web