summaryrefslogtreecommitdiffstats
path: root/drivers/rpmsg/rpmsg_core.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>2022-04-19 13:34:34 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-22 17:13:54 +0200
commite5f89131a06142e91073b6959d91cea73861d40e (patch)
treec8f7f00a9ea0597ebe66c9d48a4901051dee1ebe /drivers/rpmsg/rpmsg_core.c
parent0f4b20ef41696a625e43587563d538bb4dd60d9c (diff)
downloadlinux-e5f89131a06142e91073b6959d91cea73861d40e.tar.gz
linux-e5f89131a06142e91073b6959d91cea73861d40e.tar.bz2
linux-e5f89131a06142e91073b6959d91cea73861d40e.zip
rpmsg: Constify local variable in field store macro
Memory pointed by variable 'old' in field store macro is not modified, so it can be made a pointer to const. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20220419113435.246203-12-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/rpmsg/rpmsg_core.c')
-rw-r--r--drivers/rpmsg/rpmsg_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index 79368a957d89..95fc283f6af7 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -400,7 +400,8 @@ field##_store(struct device *dev, struct device_attribute *attr, \
const char *buf, size_t sz) \
{ \
struct rpmsg_device *rpdev = to_rpmsg_device(dev); \
- char *new, *old; \
+ const char *old; \
+ char *new; \
\
new = kstrndup(buf, sz, GFP_KERNEL); \
if (!new) \