Skip to contentSkip to conversation

include/linux/pci.h: Make struct pci_driver.name const char *

PATCH In review Joe Perches 2 participants 3 messages Sep 9, 2010 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 include/linux/pci.h: Make struct pci_driver.name const char *

As far as I can tell, name is never modified.

This would allow names to be assigned
from variables in non-writable sections.

static const foo[] = "bar";

struct pci_driver baz = {
	.name = foo;
};

---

include/linux/pci.h +1 -1
index b1d1795..acdd032 100644
@@ -541,7 +541,7 @@ struct pci_error_handlers {
 struct module;
 struct pci_driver {
 	struct list_head node;
-	char *name;
+	const char *name;
 	const struct pci_device_id *id_table;	/* must be non-NULL for probe to be called */
 	int  (*probe)  (struct pci_dev *dev, const struct pci_device_id *id);	/* New device inserted */
 	void (*remove) (struct pci_dev *dev);	/* Device removed (NULL if not a hot-plug capable driver) */
#1 lore raw
Quoted 5 lines · On Thu, 09 Sep 2010 00:38:04 -0700 Joe Perches <[email protected]> wrote:

As far as I can tell, name is never modified.

This would allow names to be assigned
from variables in non-writable sections.

Quoted 8 lines

static const foo[] = "bar";

struct pci_driver baz = {
	.name = foo;
};

---

I already sent same patch to Jesse

#2 lore raw
Quoted 4 lines · Stephen Hemminger
Quoted 1 line · On Thu, 09 Sep 2010 00:38:04 -0700 Joe Perches <[email protected]> wrote:

As far as I can tell, name is never modified.

I already sent same patch to Jesse

Great.

I found it now on linux-pci.
https://patchwork.kernel.org/project/linux-pci/list/

I think it's better to cc lkml with patches to enable easier searches of the patchwork queue in a single place.

https://patchwork.kernel.org/project/LKML/list/

cheers, Joe