Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rpmsg: core: Remove deadcode

rpmsg_send_offchannel() and rpmsg_trysend_offchannel() have been
unused since they were added in 2011's
commit bcabbccabffe ("rpmsg: add virtio-based remote processor messaging
bus")

Remove them and associated docs.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Acked-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Link: https://lore.kernel.org/r/20250429234600.301083-2-linux@treblig.org
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>

authored by

Dr. David Alan Gilbert and committed by
Mathieu Poirier
20b4f0b4 0af2f6be

-131
-46
Documentation/staging/rpmsg.rst
··· 112 112 113 113 :: 114 114 115 - int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, 116 - void *data, int len); 117 - 118 - 119 - sends a message across to the remote processor, using the src and dst 120 - addresses provided by the user. 121 - 122 - The caller should specify the endpoint, the data it wants to send, 123 - its length (in bytes), and explicit source and destination addresses. 124 - The message will then be sent to the remote processor to which the 125 - endpoint's channel belongs, but the endpoint's src and channel dst 126 - addresses will be ignored (and the user-provided addresses will 127 - be used instead). 128 - 129 - In case there are no TX buffers available, the function will block until 130 - one becomes available (i.e. until the remote processor consumes 131 - a tx buffer and puts it back on virtio's used descriptor ring), 132 - or a timeout of 15 seconds elapses. When the latter happens, 133 - -ERESTARTSYS is returned. 134 - 135 - The function can only be called from a process context (for now). 136 - Returns 0 on success and an appropriate error value on failure. 137 - 138 - :: 139 - 140 115 int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len); 141 116 142 117 sends a message across to the remote processor from a given endpoint. ··· 141 166 The message will then be sent to the remote processor to which the 142 167 channel belongs, using the channel's src address, and the user-provided 143 168 dst address (thus the channel's dst address will be ignored). 144 - 145 - In case there are no TX buffers available, the function will immediately 146 - return -ENOMEM without waiting until one becomes available. 147 - 148 - The function can only be called from a process context (for now). 149 - Returns 0 on success and an appropriate error value on failure. 150 - 151 - :: 152 - 153 - int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, 154 - void *data, int len); 155 - 156 - 157 - sends a message across to the remote processor, using source and 158 - destination addresses provided by the user. 159 - 160 - The user should specify the channel, the data it wants to send, 161 - its length (in bytes), and explicit source and destination addresses. 162 - The message will then be sent to the remote processor to which the 163 - channel belongs, but the channel's src and dst addresses will be 164 - ignored (and the user-provided addresses will be used instead). 165 169 166 170 In case there are no TX buffers available, the function will immediately 167 171 return -ENOMEM without waiting until one becomes available.
-63
drivers/rpmsg/rpmsg_core.c
··· 194 194 EXPORT_SYMBOL(rpmsg_sendto); 195 195 196 196 /** 197 - * rpmsg_send_offchannel() - send a message using explicit src/dst addresses 198 - * @ept: the rpmsg endpoint 199 - * @src: source address 200 - * @dst: destination address 201 - * @data: payload of message 202 - * @len: length of payload 203 - * 204 - * This function sends @data of length @len to the remote @dst address, 205 - * and uses @src as the source address. 206 - * The message will be sent to the remote processor which the @ept 207 - * endpoint belongs to. 208 - * In case there are no TX buffers available, the function will block until 209 - * one becomes available, or a timeout of 15 seconds elapses. When the latter 210 - * happens, -ERESTARTSYS is returned. 211 - * 212 - * Can only be called from process context (for now). 213 - * 214 - * Return: 0 on success and an appropriate error value on failure. 215 - */ 216 - int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, 217 - void *data, int len) 218 - { 219 - if (WARN_ON(!ept)) 220 - return -EINVAL; 221 - if (!ept->ops->send_offchannel) 222 - return -ENXIO; 223 - 224 - return ept->ops->send_offchannel(ept, src, dst, data, len); 225 - } 226 - EXPORT_SYMBOL(rpmsg_send_offchannel); 227 - 228 - /** 229 197 * rpmsg_trysend() - send a message across to the remote processor 230 198 * @ept: the rpmsg endpoint 231 199 * @data: payload of message ··· 268 300 return ept->ops->poll(ept, filp, wait); 269 301 } 270 302 EXPORT_SYMBOL(rpmsg_poll); 271 - 272 - /** 273 - * rpmsg_trysend_offchannel() - send a message using explicit src/dst addresses 274 - * @ept: the rpmsg endpoint 275 - * @src: source address 276 - * @dst: destination address 277 - * @data: payload of message 278 - * @len: length of payload 279 - * 280 - * This function sends @data of length @len to the remote @dst address, 281 - * and uses @src as the source address. 282 - * The message will be sent to the remote processor which the @ept 283 - * endpoint belongs to. 284 - * In case there are no TX buffers available, the function will immediately 285 - * return -ENOMEM without waiting until one becomes available. 286 - * 287 - * Can only be called from process context (for now). 288 - * 289 - * Return: 0 on success and an appropriate error value on failure. 290 - */ 291 - int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, 292 - void *data, int len) 293 - { 294 - if (WARN_ON(!ept)) 295 - return -EINVAL; 296 - if (!ept->ops->trysend_offchannel) 297 - return -ENXIO; 298 - 299 - return ept->ops->trysend_offchannel(ept, src, dst, data, len); 300 - } 301 - EXPORT_SYMBOL(rpmsg_trysend_offchannel); 302 303 303 304 /** 304 305 * rpmsg_set_flow_control() - request remote to pause/resume transmission
-22
include/linux/rpmsg.h
··· 184 184 185 185 int rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len); 186 186 int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst); 187 - int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, 188 - void *data, int len); 189 187 190 188 int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len); 191 189 int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst); 192 - int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, 193 - void *data, int len); 194 190 195 191 __poll_t rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp, 196 192 poll_table *wait); ··· 267 271 268 272 } 269 273 270 - static inline int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src, 271 - u32 dst, void *data, int len) 272 - { 273 - /* This shouldn't be possible */ 274 - WARN_ON(1); 275 - 276 - return -ENXIO; 277 - } 278 - 279 274 static inline int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len) 280 275 { 281 276 /* This shouldn't be possible */ ··· 277 290 278 291 static inline int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, 279 292 int len, u32 dst) 280 - { 281 - /* This shouldn't be possible */ 282 - WARN_ON(1); 283 - 284 - return -ENXIO; 285 - } 286 - 287 - static inline int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, 288 - u32 dst, void *data, int len) 289 293 { 290 294 /* This shouldn't be possible */ 291 295 WARN_ON(1);