Skip to content

Commit e5f8913

Browse files
krzkgregkh
authored andcommitted
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>
1 parent 0f4b20e commit e5f8913

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/rpmsg/rpmsg_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,8 @@ field##_store(struct device *dev, struct device_attribute *attr, \
400400
const char *buf, size_t sz) \
401401
{ \
402402
struct rpmsg_device *rpdev = to_rpmsg_device(dev); \
403-
char *new, *old; \
403+
const char *old; \
404+
char *new; \
404405
\
405406
new = kstrndup(buf, sz, GFP_KERNEL); \
406407
if (!new) \

0 commit comments

Comments
 (0)