* Re: [PATCH v2] drivers/of: Constify device_node->name and ->path_component_name [not found] <1353075625-7755-1-git-send-email-grant.likely@secretlab.ca> @ 2012-11-27 23:46 ` Michael Neuling 2012-11-29 16:34 ` Grant Likely 0 siblings, 1 reply; 2+ messages in thread From: Michael Neuling @ 2012-11-27 23:46 UTC (permalink / raw) To: Grant Likely Cc: Jimi Xenidis, sfr, linux-next, linux-kernel, devicetree-discuss, sparclinux, Benjamin Herrenschmidt, David S. Miller, Julian Calaby > 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. Grant, This breaks powerpc chroma_defconfig in next-20121127 with: arch/powerpc/sysdev/scom.c:160:17: error: assignment discards 'const' qualifier from pointer target type [-Werror] The following fixes it. The change is to generic code, so I'm not sure it's the right fix as it may break other configs/archs. diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 66c434f..77f64e4 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h @@ -23,7 +23,7 @@ struct file_operations; struct debugfs_blob_wrapper { - void *data; + const void *data; unsigned long size; }; ^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] drivers/of: Constify device_node->name and ->path_component_name 2012-11-27 23:46 ` [PATCH v2] drivers/of: Constify device_node->name and ->path_component_name Michael Neuling @ 2012-11-29 16:34 ` Grant Likely 0 siblings, 0 replies; 2+ messages in thread From: Grant Likely @ 2012-11-29 16:34 UTC (permalink / raw) To: Michael Neuling Cc: Jimi Xenidis, sfr, linux-next, linux-kernel, devicetree-discuss, sparclinux, Benjamin Herrenschmidt, David S. Miller, Julian Calaby On Wed, 28 Nov 2012 10:46:04 +1100, Michael Neuling <mikey@neuling.org> wrote: > > 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. > > Grant, > > This breaks powerpc chroma_defconfig in next-20121127 with: > > arch/powerpc/sysdev/scom.c:160:17: error: assignment discards 'const' qualifier from pointer target type [-Werror] > > The following fixes it. The change is to generic code, so I'm not sure > it's the right fix as it may break other configs/archs. That is rather risky. Post it as a patch to core code, but in the mean time I'll patch the powerpc scom code. g. ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-29 16:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1353075625-7755-1-git-send-email-grant.likely@secretlab.ca>
2012-11-27 23:46 ` [PATCH v2] drivers/of: Constify device_node->name and ->path_component_name Michael Neuling
2012-11-29 16:34 ` Grant Likely
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).