public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] include/linux/pci.h: Make struct pci_driver.name const char *
@ 2010-09-09  7:38 Joe Perches
  2010-09-09 14:54 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2010-09-09  7:38 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: linux-pci, LKML, Stephen Hemminger

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;
};

Signed-off-by: Joe Perches <joe@perches.com>
---
diff --git a/include/linux/pci.h b/include/linux/pci.h
index b1d1795..acdd032 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -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) */



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-09 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-09  7:38 [PATCH] include/linux/pci.h: Make struct pci_driver.name const char * Joe Perches
2010-09-09 14:54 ` Stephen Hemminger
2010-09-09 15:23   ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox