* [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* Re: [PATCH] include/linux/pci.h: Make struct pci_driver.name const char * 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 0 siblings, 1 reply; 3+ messages in thread From: Stephen Hemminger @ 2010-09-09 14:54 UTC (permalink / raw) To: Joe Perches; +Cc: Jesse Barnes, linux-pci, LKML On Thu, 09 Sep 2010 00:38:04 -0700 Joe Perches <joe@perches.com> wrote: > 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> > --- I already sent same patch to Jesse ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] include/linux/pci.h: Make struct pci_driver.name const char * 2010-09-09 14:54 ` Stephen Hemminger @ 2010-09-09 15:23 ` Joe Perches 0 siblings, 0 replies; 3+ messages in thread From: Joe Perches @ 2010-09-09 15:23 UTC (permalink / raw) To: Stephen Hemminger; +Cc: Jesse Barnes, linux-pci, LKML On Thu, 2010-09-09 at 07:54 -0700, Stephen Hemminger wrote: > On Thu, 09 Sep 2010 00:38:04 -0700 > Joe Perches <joe@perches.com> 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 ^ permalink raw reply [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