From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EF09210F9 for ; Mon, 6 Nov 2023 13:12:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="bueL5oeu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C77F7C433C8; Mon, 6 Nov 2023 13:11:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1699276320; bh=OaP+Rr2aMTgc7jl2ixRIRPDcIHiV3joADqAi59aFtRU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bueL5oeuiub0npzkG8B7S9BG66jqfvbS8ZxBDQ1oAowsMkDGGpiSJGv/wVLxwYPjO zboyyLCNE+ljM5bv/fEOv62fPvJM9cX9sA3A9MZOAZf61A7xBdrvI1+6nOq+PoEq38 XoDCwMBua4l1Wva5xhiucCcJNh/DbYW4o9krFISk= From: Greg Kroah-Hartman To: stable@vger.kernel.org, lee@kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Krzysztof Kozlowski Subject: [PATCH 4.19 35/61] rpmsg: Constify local variable in field store macro Date: Mon, 6 Nov 2023 14:03:31 +0100 Message-ID: <20231106130300.820808995@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231106130259.573843228@linuxfoundation.org> References: <20231106130259.573843228@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Krzysztof Kozlowski 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 Link: https://lore.kernel.org/r/20220419113435.246203-12-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Lee Jones Signed-off-by: Greg Kroah-Hartman --- drivers/rpmsg/rpmsg_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -332,7 +332,8 @@ field##_store(struct device *dev, struct 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) \