From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E1E8D116F8 for ; Sun, 30 Nov 2025 12:36:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dARi/iKdT6YHQNj2xjIFbOozMfb2GveeEYQmMb8Fa4k=; b=IVKoZCBDw1xmw1MLE/tCfFRQ4+ a+dNgsHvNQFcXHkq6ml1wk+CiGINzr3yYMA5D04L/XCp38Tya9TQdDEs+d9DGrXJwOv7G8xUN0Fkb 122vxn/JBY9oGe/NHEeKLwukn0rmD1i4+EkgWs8XtnPqShyKf+bpkwdbuGZiA+dGaV4X5xF44k39O F+0IRJ3Tt9Q0ZPKIhPt3cib2v+fhdw1OmPlDdDTcg9YWRsNRyeBLoQBJy5dz1tsZ36K4DGg4hZA7M /JtlPgntSW9hjacg86/cXfTNCvKrZeBYpWhIetvGjBCxxcQgRSNTrfzP1+G7Z+gNYsriEOHVvRhe+ NwG+eXww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vPgfI-00000002I2d-04Xa; Sun, 30 Nov 2025 12:36:32 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vPgfA-00000002HxW-1gc3 for linux-arm-kernel@lists.infradead.org; Sun, 30 Nov 2025 12:36:25 +0000 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AU6DO9l595470 for ; Sun, 30 Nov 2025 12:36:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= dARi/iKdT6YHQNj2xjIFbOozMfb2GveeEYQmMb8Fa4k=; b=oJ+n+iKsmBVUZGJ/ CXjTgMsh1G4BlD+ywIVzUrt/gfNQYVj/tdr3kvkch158U2ApUXVDgczPT4kcxPd4 kHqkxKhFHqdc0HlCPlz6QGuXiAMWd9g1yd1gEWWk/b9w3sh8kitc/J418Ga5gW05 5aw1rW9FCIdg2GpMZTXdkHAPAu3q8KdCrOUOAtfX8oi+lt/t3oSK75RQwNcnNWmi 0WMbAcNbSWsULGhNKuFnlY9qUdmDos96osmu6FrabLU4nqjUWOozn1iGDaPm5ULg HwX3+KkzCf0X+J6O3M7B3hRJjHEis9H9hpZ09RqFq6GbtlEdwMDYDuTur0MZNTAR BklT4g== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4aqphfacgg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 30 Nov 2025 12:36:23 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8b53c30bb59so467732185a.1 for ; Sun, 30 Nov 2025 04:36:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1764506182; x=1765110982; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=dARi/iKdT6YHQNj2xjIFbOozMfb2GveeEYQmMb8Fa4k=; b=Wol9VqoXL2UBNEBKazs0UeOKVzflGKlAxVL+CUfEvKPltiUJoeqe881WiczZGlu98N ugTrbUt8k7VH5ZijlbtEqRT6vLgXxNbunDQdfsJ+d7RGG1xzY6tGmMm7p1k/dnzLr9xC fXutJecyoSUKrC5+c1QwRghcan8UKghKNFysSgM2tioOI9/iHZa1pwGjx7gX/D5N2CG7 hsM0ga5FN4ntEx0haBY5DkrCLojhgiX9Etc7SMZ0h4+NV3gcxnvrUVZU4k+o3DsDnBGj 4BAvkgWNj0SvhZOPih6BWMBUfubQ36eqzsiERfE+2S4npJB9F6pXsY6XjBvUyZ+S++5R RfVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764506182; x=1765110982; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=dARi/iKdT6YHQNj2xjIFbOozMfb2GveeEYQmMb8Fa4k=; b=u7MhTr22Vs0b/LgIkVNCFFCwK9UOy1gdC30dauFKQ2gkxGRFKKSenBoL9DhYI254cB FWK/yk3qSIcsihWkYAgbw6v6iD2qC8ZClKnwHZrG3RCI2XIfWyd4lCszmQPGEexqEzso kN1FfGDIODkAHjaLlnYdNnNDr/5h48WwkPXmxYMWnSjIzzZeiAxA0EsJ0OTJW0CxdUwY rFmUgPIxnyrAFTufL9gaiXkNvY6wFEq4Sb2HbBbyNnN+mkefBzBOVaJtAbndFpoo3iQt uKOKXEK8n0QgMsRfFy0Hv+OjtIJfGgJ4/sidCKG+8+nmM/3WJ1ZZ7hxBP/BkJmPe+Jqi snnQ== X-Forwarded-Encrypted: i=1; AJvYcCXd2SUcA8Zn9UEHbaecYaCOghX86a5NqUcM2fu9/VMwDtTEr6CpgF/SLjMj434WNZzb1q447o1s8KWWiRSQBDqf@lists.infradead.org X-Gm-Message-State: AOJu0YzI+QtsrqpfwukQnRzp8ogX+SdlK9EUwcqj92sMln0HID3KKGJJ H2c8p5zDb/M+Q9Eg9ba/9u+LUd6zjHUkHVD/qlbulRrhj/T1CzBc0V3J7P+19XywdKS7Pd3nVi7 ZpktJUFF6a22Rkk+RVl+Fd8deyaPVfQfusHgJ9AwCTW1bBu8wUqPY8aF5/IM5Z9NVLFZ1BNnUhC 1JWw== X-Gm-Gg: ASbGnctCHvBRB6yxF786HkyN5NYKItxe5afwUtxdSjdEd12GPHiaSFOahVq7ESxayzG k3O4fQNbWurbDmti3mXMyCvHAmMCEaqh1XtMGPSPTvXMX1oQNnCrDc8EgjdUSWLOcA2qfFDax91 gK0VSiy3FLWk2FO5hngjaOcSqpEyyouHxH2uj/Jdf8otzC1QkZXt5qvKHfBNC6lLDa2RhUXrrxn eluUOtPgb9XrijHlNxR2ZSiA8LgKFBu5WV62JQRTa2WTnKw3/rcUpJJmXIckiFzCEyRrkjlRtal BSe5V5TWkXauCZfepQrJEcuktEzAnLeLvdMjgrwXiU7I3MPJZ39ZuYigZQbD74K9vyrgOYXwb0w hnyq7KsF0OpM76l/ypYVUJmxU2aIvReVW6A== X-Received: by 2002:a05:620a:45a3:b0:8a9:b1bb:fcb1 with SMTP id af79cd13be357-8b4ebd54520mr2850377085a.15.1764506182070; Sun, 30 Nov 2025 04:36:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IGEgZrd7ydwt7marmpb1vwhLSYebkPk/ReUbPpzq6DcU/1phgO3nPD29R+bvHO+ffA7kL4GXA== X-Received: by 2002:a05:620a:45a3:b0:8a9:b1bb:fcb1 with SMTP id af79cd13be357-8b4ebd54520mr2850371785a.15.1764506181462; Sun, 30 Nov 2025 04:36:21 -0800 (PST) Received: from [127.0.1.1] ([178.197.195.159]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b76f51c6c12sm920506666b.29.2025.11.30.04.36.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Nov 2025 04:36:20 -0800 (PST) From: Krzysztof Kozlowski Date: Sun, 30 Nov 2025 13:36:10 +0100 Subject: [PATCH 3/4] rpmsg: Constify buffer passed to send API MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20251130-rpmsg-send-const-v1-3-cb11c7e0a024@oss.qualcomm.com> References: <20251130-rpmsg-send-const-v1-0-cb11c7e0a024@oss.qualcomm.com> In-Reply-To: <20251130-rpmsg-send-const-v1-0-cb11c7e0a024@oss.qualcomm.com> To: Bjorn Andersson , Mathieu Poirier , Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla , Konrad Dybcio , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=13550; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=iTRd+rIeM0i/pGucaXFPZ9D6qmjfk35erqlIaeNAJhM=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBpLDo8N/dNhNeRqEnlC/v3jVdSTzvhCqXPENCaD Us6fAJ2xoKJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaSw6PAAKCRDBN2bmhouD 11ZREACBOq1dY/GNaTLrAA6ziQ59OT938SUPowxfvxNxZPPOS+rbuOswQZxkPHF1t8R+HMt3WkT +fihX5v7rbFzhKUkWtOqVWYY8UHoIUAdx2/MGhcEqwIQn4PCeT43Od+58rUPCp6eLT27r/MNs0b +0pGZdsCPsZ5xL1f4TpQTuUQx0le+azaUpnLvtzEdohuudxoeT6Bnbx6dzaFqIUfbYdMb1m1UPM 5YEbzBXgnZGPBT0uywIOb65O5AQcXPcJiEgOq1TkrmPDoU4gDnaVdQ3nr3THh/AQC7W2JoZm/5V WqeHpeLgMWOpZbhYZR4GHDHg87kPmpzDagDwrSaiggButugls5iHKSqE9I2c3YpDINjh0Vt2dVn KT9vu56ovP4oIptRFT2LZEYcUa7I5gWhYnIgk/KnjnDxC9o8caA+5N9Lel5SqrNckoxB5PJvjj8 dauNBbNguJ7ZnsGvKSyTYaA0XswWCeQMUJXLuI7/RfaO57n8guKey38itk14dj1e/CnEbXpGotB DyUxk4qCAjivqPt+/OvPaLqeTYY1Nbmoc8xP1juSDnuO+tQCUwn7IlwKbueRZCCoYeD+bs0FqqX QlP00cpzev5ABCUXeX69X9W9ZgUSrFzlti83zMUlBkFkNIhTWumqlwU502e/6pqtQLXOL3Lm+Aj iuE1Ulj8f2t94IQ== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-ORIG-GUID: jJHLxQqT8Ztm4tMJ-WxByzJX9G5aTb2i X-Authority-Analysis: v=2.4 cv=FvwIPmrq c=1 sm=1 tr=0 ts=692c3a47 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=FPK7cjBCgYbqzSTDLBmM0Q==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=jKNRGAx6QiKp0B1Iy_QA:9 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTMwMDEwOCBTYWx0ZWRfXyIaHvJygt+54 aGhPP0iQ1h2u8twgQF0sGB/5Id584xmSKErLoVnCiNq+D6+S+jho4TRUJqRwObsLLmANxho8LoR 9NYx131z8WYkbCBq43n2Pvzz8pDG/mGNJ05BNz3DKs7/N8cKgaFK93pDEFfiTYV2BF7ywL0H1gV 2uMVlEAMatlEZfhT/6R5VNYVuv08pzWPkPsuxz+TzjHc3F479LgbWtjxmaFGlzlKavGYEGYFnwQ 8FZtFUt/tWV1kcNyxy4YrUTWtbe80DCd20ZgNDWaA8/Y3fR6p+LziFJA9OGs67yKfPov5oY3XfI NiHc22W5WwcjQ2307E0ns+bjdIlkEkzd24tU4g4+qH96YOkLo4ksugmRlWdkvMn4hM5lXzbxjan X7urxHvoePpQZ8fhp2aTBzr6u42/jA== X-Proofpoint-GUID: jJHLxQqT8Ztm4tMJ-WxByzJX9G5aTb2i X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-28_08,2025-11-27_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 suspectscore=0 malwarescore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511300108 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251130_043624_448664_E6796F4B X-CRM114-Status: GOOD ( 18.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Signed-off-by: Krzysztof Kozlowski --- Patch necessary for the further patches, please keep with the rest. send const --- drivers/rpmsg/mtk_rpmsg.c | 4 ++-- drivers/rpmsg/qcom_glink_native.c | 13 ++++++++----- drivers/rpmsg/qcom_smd.c | 10 ++++++---- drivers/rpmsg/rpmsg_core.c | 8 ++++---- drivers/rpmsg/rpmsg_internal.h | 8 ++++---- drivers/rpmsg/virtio_rpmsg_bus.c | 24 +++++++++++++----------- include/linux/rpmsg.h | 17 +++++++++-------- 7 files changed, 46 insertions(+), 38 deletions(-) diff --git a/drivers/rpmsg/mtk_rpmsg.c b/drivers/rpmsg/mtk_rpmsg.c index d1213c33da20..4398f0bec155 100644 --- a/drivers/rpmsg/mtk_rpmsg.c +++ b/drivers/rpmsg/mtk_rpmsg.c @@ -135,7 +135,7 @@ static void mtk_rpmsg_destroy_ept(struct rpmsg_endpoint *ept) kref_put(&ept->refcount, __mtk_ept_release); } -static int mtk_rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len) +static int mtk_rpmsg_send(struct rpmsg_endpoint *ept, const void *data, int len) { struct mtk_rpmsg_rproc_subdev *mtk_subdev = to_mtk_rpmsg_endpoint(ept)->mtk_subdev; @@ -144,7 +144,7 @@ static int mtk_rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len) len, 0); } -static int mtk_rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len) +static int mtk_rpmsg_trysend(struct rpmsg_endpoint *ept, const void *data, int len) { struct mtk_rpmsg_rproc_subdev *mtk_subdev = to_mtk_rpmsg_endpoint(ept)->mtk_subdev; diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index 820a6ca5b1d7..db696e1c8ca3 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -1461,7 +1461,7 @@ static int qcom_glink_request_intent(struct qcom_glink *glink, } static int __qcom_glink_send(struct glink_channel *channel, - void *data, int len, bool wait) + const void *data, int len, bool wait) { struct qcom_glink *glink = channel->glink; struct glink_core_rx_intent *intent = NULL; @@ -1540,28 +1540,31 @@ static int __qcom_glink_send(struct glink_channel *channel, return 0; } -static int qcom_glink_send(struct rpmsg_endpoint *ept, void *data, int len) +static int qcom_glink_send(struct rpmsg_endpoint *ept, const void *data, int len) { struct glink_channel *channel = to_glink_channel(ept); return __qcom_glink_send(channel, data, len, true); } -static int qcom_glink_trysend(struct rpmsg_endpoint *ept, void *data, int len) +static int qcom_glink_trysend(struct rpmsg_endpoint *ept, const void *data, + int len) { struct glink_channel *channel = to_glink_channel(ept); return __qcom_glink_send(channel, data, len, false); } -static int qcom_glink_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst) +static int qcom_glink_sendto(struct rpmsg_endpoint *ept, const void *data, + int len, u32 dst) { struct glink_channel *channel = to_glink_channel(ept); return __qcom_glink_send(channel, data, len, true); } -static int qcom_glink_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst) +static int qcom_glink_trysendto(struct rpmsg_endpoint *ept, const void *data, + int len, u32 dst) { struct glink_channel *channel = to_glink_channel(ept); diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c index 42594f5ee438..1c6ae8c22100 100644 --- a/drivers/rpmsg/qcom_smd.c +++ b/drivers/rpmsg/qcom_smd.c @@ -960,28 +960,30 @@ static void qcom_smd_destroy_ept(struct rpmsg_endpoint *ept) kref_put(&ept->refcount, __ept_release); } -static int qcom_smd_send(struct rpmsg_endpoint *ept, void *data, int len) +static int qcom_smd_send(struct rpmsg_endpoint *ept, const void *data, int len) { struct qcom_smd_endpoint *qsept = to_smd_endpoint(ept); return __qcom_smd_send(qsept->qsch, data, len, true); } -static int qcom_smd_trysend(struct rpmsg_endpoint *ept, void *data, int len) +static int qcom_smd_trysend(struct rpmsg_endpoint *ept, const void *data, int len) { struct qcom_smd_endpoint *qsept = to_smd_endpoint(ept); return __qcom_smd_send(qsept->qsch, data, len, false); } -static int qcom_smd_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst) +static int qcom_smd_sendto(struct rpmsg_endpoint *ept, const void *data, int len, + u32 dst) { struct qcom_smd_endpoint *qsept = to_smd_endpoint(ept); return __qcom_smd_send(qsept->qsch, data, len, true); } -static int qcom_smd_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst) +static int qcom_smd_trysendto(struct rpmsg_endpoint *ept, const void *data, + int len, u32 dst) { struct qcom_smd_endpoint *qsept = to_smd_endpoint(ept); diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index 5d661681a9b6..cac8e5227579 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -153,7 +153,7 @@ EXPORT_SYMBOL(rpmsg_destroy_ept); * * Return: 0 on success and an appropriate error value on failure. */ -int rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len) +int rpmsg_send(struct rpmsg_endpoint *ept, const void *data, int len) { if (WARN_ON(!ept)) return -EINVAL; @@ -182,7 +182,7 @@ EXPORT_SYMBOL(rpmsg_send); * * Return: 0 on success and an appropriate error value on failure. */ -int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst) +int rpmsg_sendto(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst) { if (WARN_ON(!ept)) return -EINVAL; @@ -210,7 +210,7 @@ EXPORT_SYMBOL(rpmsg_sendto); * * Return: 0 on success and an appropriate error value on failure. */ -int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len) +int rpmsg_trysend(struct rpmsg_endpoint *ept, const void *data, int len) { if (WARN_ON(!ept)) return -EINVAL; @@ -238,7 +238,7 @@ EXPORT_SYMBOL(rpmsg_trysend); * * Return: 0 on success and an appropriate error value on failure. */ -int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst) +int rpmsg_trysendto(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst) { if (WARN_ON(!ept)) return -EINVAL; diff --git a/drivers/rpmsg/rpmsg_internal.h b/drivers/rpmsg/rpmsg_internal.h index 397e4926bd02..a8b7065fd165 100644 --- a/drivers/rpmsg/rpmsg_internal.h +++ b/drivers/rpmsg/rpmsg_internal.h @@ -63,11 +63,11 @@ struct rpmsg_device_ops { struct rpmsg_endpoint_ops { void (*destroy_ept)(struct rpmsg_endpoint *ept); - int (*send)(struct rpmsg_endpoint *ept, void *data, int len); - int (*sendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst); + int (*send)(struct rpmsg_endpoint *ept, const void *data, int len); + int (*sendto)(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst); - int (*trysend)(struct rpmsg_endpoint *ept, void *data, int len); - int (*trysendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst); + int (*trysend)(struct rpmsg_endpoint *ept, const void *data, int len); + int (*trysendto)(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst); __poll_t (*poll)(struct rpmsg_endpoint *ept, struct file *filp, poll_table *wait); int (*set_flow_control)(struct rpmsg_endpoint *ept, bool pause, u32 dst); diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 484890b4a6a7..6559de61da6d 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c @@ -138,11 +138,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 ssize_t virtio_rpmsg_get_mtu(struct rpmsg_endpoint *ept); static struct rpmsg_device *__rpmsg_create_channel(struct virtproc_info *vrp, @@ -546,7 +547,7 @@ static void rpmsg_downref_sleepers(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; @@ -642,7 +643,7 @@ static int rpmsg_send_offchannel_raw(struct rpmsg_device *rpdev, 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; @@ -650,8 +651,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; @@ -659,7 +660,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; @@ -667,7 +669,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; diff --git a/include/linux/rpmsg.h b/include/linux/rpmsg.h index fb7ab9165645..83266ce14642 100644 --- a/include/linux/rpmsg.h +++ b/include/linux/rpmsg.h @@ -182,11 +182,11 @@ struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *, rpmsg_rx_cb_t cb, void *priv, struct rpmsg_channel_info chinfo); -int rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len); -int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst); +int rpmsg_send(struct rpmsg_endpoint *ept, const void *data, int len); +int rpmsg_sendto(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst); -int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len); -int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst); +int rpmsg_trysend(struct rpmsg_endpoint *ept, const void *data, int len); +int rpmsg_trysendto(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst); __poll_t rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp, poll_table *wait); @@ -249,7 +249,7 @@ static inline struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *rpdev return NULL; } -static inline int rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len) +static inline int rpmsg_send(struct rpmsg_endpoint *ept, const void *data, int len) { /* This shouldn't be possible */ WARN_ON(1); @@ -257,7 +257,7 @@ static inline int rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len) return -ENXIO; } -static inline int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len, +static inline int rpmsg_sendto(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst) { /* This shouldn't be possible */ @@ -267,7 +267,8 @@ static inline int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len, } -static inline int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len) +static inline int rpmsg_trysend(struct rpmsg_endpoint *ept, const void *data, + int len) { /* This shouldn't be possible */ WARN_ON(1); @@ -275,7 +276,7 @@ static inline int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len) return -ENXIO; } -static inline int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, +static inline int rpmsg_trysendto(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst) { /* This shouldn't be possible */ -- 2.48.1