drivers/of: Constify device_node->name and ->path_component_name
Neither of these should ever be changed once set. Make them const and fix up the users that try to modify it in-place. In one case kmalloc+memcpy is replaced with kstrdup() to avoid modifying the string. Build tested with defconfigs on ARM, PowerPC, Sparc, MIPS, x86 among others. Signed-off-by:Grant Likely <grant.likely@secretlab.ca> Acked-by:
David S. Miller <davem@davemloft.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Julian Calaby <julian.calaby@gmail.com>
Showing
- arch/powerpc/platforms/powermac/pfunc_core.c 1 addition, 1 deletionarch/powerpc/platforms/powermac/pfunc_core.c
- arch/powerpc/platforms/pseries/reconfig.c 1 addition, 2 deletionsarch/powerpc/platforms/pseries/reconfig.c
- arch/powerpc/sysdev/fsl_pci.c 1 addition, 1 deletionarch/powerpc/sysdev/fsl_pci.c
- arch/sparc/kernel/pci_impl.h 1 addition, 1 deletionarch/sparc/kernel/pci_impl.h
- drivers/of/fdt.c 5 additions, 5 deletionsdrivers/of/fdt.c
- include/linux/of.h 2 additions, 2 deletionsinclude/linux/of.h
Please register or sign in to comment