All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: lee@kernel.org
Cc: stable@vger.kernel.org,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH v4.19.y 2/6] rpmsg: Constify local variable in field store macro
Date: Tue, 31 Oct 2023 11:39:48 +0000	[thread overview]
Message-ID: <20231031113956.2287681-2-lee@kernel.org> (raw)
In-Reply-To: <20231031113956.2287681-1-lee@kernel.org>

From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

commit e5f89131a06142e91073b6959d91cea73861d40e upstream.

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>
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/rpmsg/rpmsg_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index 65834153ba977..19c7df92c63e0 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -332,7 +332,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)							\
-- 
2.42.0.820.g83a721a137-goog


  reply	other threads:[~2023-10-31 11:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-31 11:39 [PATCH v4.19.y 1/6] driver: platform: Add helper for safer setting of driver_override Lee Jones
2023-10-31 11:39 ` Lee Jones [this message]
2023-10-31 11:39 ` [PATCH v4.19.y 3/6] rpmsg: Fix kfree() of static memory on setting driver_override Lee Jones
2023-10-31 11:39 ` [PATCH v4.19.y 4/6] rpmsg: Fix calling device_lock() on non-initialized device Lee Jones
2023-10-31 11:39 ` [PATCH v4.19.y 5/6] rpmsg: glink: Release driver_override Lee Jones
2023-10-31 11:39 ` [PATCH v4.19.y 6/6] rpmsg: Fix possible refcount leak in rpmsg_register_device_override() Lee Jones
  -- strict thread matches above, loose matches on Subject: below --
2023-10-31  9:30 [PATCH v4.19.y 1/6] driver: platform: Add helper for safer setting of driver_override Lee Jones
2023-10-31  9:30 ` [PATCH v4.19.y 2/6] rpmsg: Constify local variable in field store macro Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231031113956.2287681-2-lee@kernel.org \
    --to=lee@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.