mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
rpmsg: Constify buffer passed to send API
The rpmsg_send(), rpmsg_sendto() and other variants of sending interfaces should only send the passed data, without modifying its contents, so mark pointer 'data' as pointer to const. All users of this interface already follow this approach, so only the function declarations have to be updated. Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260317-rpmsg-send-const-v3-3-4d7fd27f037f@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
committed by
Bjorn Andersson
parent
90dacbf4bf
commit
b8077b4da2
@@ -136,11 +136,12 @@ struct virtio_rpmsg_channel {
|
||||
#define RPMSG_RESERVED_ADDRESSES (1024)
|
||||
|
||||
static void virtio_rpmsg_destroy_ept(struct rpmsg_endpoint *ept);
|
||||
static int virtio_rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len);
|
||||
static int virtio_rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len,
|
||||
u32 dst);
|
||||
static int virtio_rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len);
|
||||
static int virtio_rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data,
|
||||
static int virtio_rpmsg_send(struct rpmsg_endpoint *ept, const void *data, int len);
|
||||
static int virtio_rpmsg_sendto(struct rpmsg_endpoint *ept, const void *data,
|
||||
int len, u32 dst);
|
||||
static int virtio_rpmsg_trysend(struct rpmsg_endpoint *ept, const void *data,
|
||||
int len);
|
||||
static int virtio_rpmsg_trysendto(struct rpmsg_endpoint *ept, const void *data,
|
||||
int len, u32 dst);
|
||||
static __poll_t virtio_rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
|
||||
poll_table *wait);
|
||||
@@ -490,7 +491,7 @@ static void *get_a_tx_buf(struct virtproc_info *vrp)
|
||||
*/
|
||||
static int rpmsg_send_offchannel_raw(struct rpmsg_device *rpdev,
|
||||
u32 src, u32 dst,
|
||||
void *data, int len, bool wait)
|
||||
const void *data, int len, bool wait)
|
||||
{
|
||||
struct virtio_rpmsg_channel *vch = to_virtio_rpmsg_channel(rpdev);
|
||||
struct virtproc_info *vrp = vch->vrp;
|
||||
@@ -580,7 +581,7 @@ out:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int virtio_rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len)
|
||||
static int virtio_rpmsg_send(struct rpmsg_endpoint *ept, const void *data, int len)
|
||||
{
|
||||
struct rpmsg_device *rpdev = ept->rpdev;
|
||||
u32 src = ept->addr, dst = rpdev->dst;
|
||||
@@ -588,8 +589,8 @@ static int virtio_rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len)
|
||||
return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, true);
|
||||
}
|
||||
|
||||
static int virtio_rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len,
|
||||
u32 dst)
|
||||
static int virtio_rpmsg_sendto(struct rpmsg_endpoint *ept, const void *data,
|
||||
int len, u32 dst)
|
||||
{
|
||||
struct rpmsg_device *rpdev = ept->rpdev;
|
||||
u32 src = ept->addr;
|
||||
@@ -597,7 +598,8 @@ static int virtio_rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len,
|
||||
return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, true);
|
||||
}
|
||||
|
||||
static int virtio_rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len)
|
||||
static int virtio_rpmsg_trysend(struct rpmsg_endpoint *ept, const void *data,
|
||||
int len)
|
||||
{
|
||||
struct rpmsg_device *rpdev = ept->rpdev;
|
||||
u32 src = ept->addr, dst = rpdev->dst;
|
||||
@@ -605,7 +607,7 @@ static int virtio_rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len)
|
||||
return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, false);
|
||||
}
|
||||
|
||||
static int virtio_rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data,
|
||||
static int virtio_rpmsg_trysendto(struct rpmsg_endpoint *ept, const void *data,
|
||||
int len, u32 dst)
|
||||
{
|
||||
struct rpmsg_device *rpdev = ept->rpdev;
|
||||
|
||||
Reference in New Issue
Block a user