diff options
-rw-r--r-- | arch/powerpc/platforms/powermac/pfunc_core.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/reconfig.c | 3 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_pci.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/pci_impl.h | 2 | ||||
-rw-r--r-- | drivers/of/fdt.c | 10 | ||||
-rw-r--r-- | include/linux/of.h | 4 |
6 files changed, 11 insertions, 12 deletions
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c index b0c3777528a1..d588e48dff74 100644 --- a/arch/powerpc/platforms/powermac/pfunc_core.c +++ b/arch/powerpc/platforms/powermac/pfunc_core.c | |||
@@ -686,7 +686,7 @@ static int pmf_add_functions(struct pmf_device *dev, void *driverdata) | |||
686 | int count = 0; | 686 | int count = 0; |
687 | 687 | ||
688 | for (pp = dev->node->properties; pp != 0; pp = pp->next) { | 688 | for (pp = dev->node->properties; pp != 0; pp = pp->next) { |
689 | char *name; | 689 | const char *name; |
690 | if (strncmp(pp->name, PP_PREFIX, plen) != 0) | 690 | if (strncmp(pp->name, PP_PREFIX, plen) != 0) |
691 | continue; | 691 | continue; |
692 | name = pp->name + plen; | 692 | name = pp->name + plen; |
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index 39f71fba9b38..2f4668136b20 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c | |||
@@ -281,12 +281,11 @@ static struct property *new_property(const char *name, const int length, | |||
281 | if (!new) | 281 | if (!new) |
282 | return NULL; | 282 | return NULL; |
283 | 283 | ||
284 | if (!(new->name = kmalloc(strlen(name) + 1, GFP_KERNEL))) | 284 | if (!(new->name = kstrdup(name, GFP_KERNEL))) |
285 | goto cleanup; | 285 | goto cleanup; |
286 | if (!(new->value = kmalloc(length + 1, GFP_KERNEL))) | 286 | if (!(new->value = kmalloc(length + 1, GFP_KERNEL))) |
287 | goto cleanup; | 287 | goto cleanup; |
288 | 288 | ||
289 | strcpy(new->name, name); | ||
290 | memcpy(new->value, value, length); | 289 | memcpy(new->value, value, length); |
291 | *(((char *)new->value) + length) = 0; | 290 | *(((char *)new->value) + length) = 0; |
292 | new->length = length; | 291 | new->length = length; |
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index ffb93ae9379b..01b62a62c635 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c | |||
@@ -136,7 +136,7 @@ static void __init setup_pci_atmu(struct pci_controller *hose, | |||
136 | u32 pcicsrbar = 0, pcicsrbar_sz; | 136 | u32 pcicsrbar = 0, pcicsrbar_sz; |
137 | u32 piwar = PIWAR_EN | PIWAR_PF | PIWAR_TGI_LOCAL | | 137 | u32 piwar = PIWAR_EN | PIWAR_PF | PIWAR_TGI_LOCAL | |
138 | PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP; | 138 | PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP; |
139 | char *name = hose->dn->full_name; | 139 | const char *name = hose->dn->full_name; |
140 | const u64 *reg; | 140 | const u64 *reg; |
141 | int len; | 141 | int len; |
142 | 142 | ||
diff --git a/arch/sparc/kernel/pci_impl.h b/arch/sparc/kernel/pci_impl.h index 918a2031c8bb..5f688531f48c 100644 --- a/arch/sparc/kernel/pci_impl.h +++ b/arch/sparc/kernel/pci_impl.h | |||
@@ -88,7 +88,7 @@ struct pci_pbm_info { | |||
88 | int chip_revision; | 88 | int chip_revision; |
89 | 89 | ||
90 | /* Name used for top-level resources. */ | 90 | /* Name used for top-level resources. */ |
91 | char *name; | 91 | const char *name; |
92 | 92 | ||
93 | /* OBP specific information. */ | 93 | /* OBP specific information. */ |
94 | struct platform_device *op; | 94 | struct platform_device *op; |
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index c2b08dcdbc53..c8be32644c85 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
@@ -199,10 +199,10 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob, | |||
199 | np = unflatten_dt_alloc(&mem, sizeof(struct device_node) + allocl, | 199 | np = unflatten_dt_alloc(&mem, sizeof(struct device_node) + allocl, |
200 | __alignof__(struct device_node)); | 200 | __alignof__(struct device_node)); |
201 | if (allnextpp) { | 201 | if (allnextpp) { |
202 | char *fn; | ||
202 | memset(np, 0, sizeof(*np)); | 203 | memset(np, 0, sizeof(*np)); |
203 | np->full_name = ((char *)np) + sizeof(struct device_node); | 204 | np->full_name = fn = ((char *)np) + sizeof(*np); |
204 | if (new_format) { | 205 | if (new_format) { |
205 | char *fn = np->full_name; | ||
206 | /* rebuild full path for new format */ | 206 | /* rebuild full path for new format */ |
207 | if (dad && dad->parent) { | 207 | if (dad && dad->parent) { |
208 | strcpy(fn, dad->full_name); | 208 | strcpy(fn, dad->full_name); |
@@ -216,9 +216,9 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob, | |||
216 | fn += strlen(fn); | 216 | fn += strlen(fn); |
217 | } | 217 | } |
218 | *(fn++) = '/'; | 218 | *(fn++) = '/'; |
219 | memcpy(fn, pathp, l); | 219 | } |
220 | } else | 220 | memcpy(fn, pathp, l); |
221 | memcpy(np->full_name, pathp, l); | 221 | |
222 | prev_pp = &np->properties; | 222 | prev_pp = &np->properties; |
223 | **allnextpp = np; | 223 | **allnextpp = np; |
224 | *allnextpp = &np->allnext; | 224 | *allnextpp = &np->allnext; |
diff --git a/include/linux/of.h b/include/linux/of.h index b4e50d56fc74..857dde984a6e 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -46,7 +46,7 @@ struct device_node { | |||
46 | const char *name; | 46 | const char *name; |
47 | const char *type; | 47 | const char *type; |
48 | phandle phandle; | 48 | phandle phandle; |
49 | char *full_name; | 49 | const char *full_name; |
50 | 50 | ||
51 | struct property *properties; | 51 | struct property *properties; |
52 | struct property *deadprops; /* removed properties */ | 52 | struct property *deadprops; /* removed properties */ |
@@ -60,7 +60,7 @@ struct device_node { | |||
60 | unsigned long _flags; | 60 | unsigned long _flags; |
61 | void *data; | 61 | void *data; |
62 | #if defined(CONFIG_SPARC) | 62 | #if defined(CONFIG_SPARC) |
63 | char *path_component_name; | 63 | const char *path_component_name; |
64 | unsigned int unique_id; | 64 | unsigned int unique_id; |
65 | struct of_irq_controller *irq_trans; | 65 | struct of_irq_controller *irq_trans; |
66 | #endif | 66 | #endif |