rpmsg offchannel deadcoding
Subsystems (2)
v3 cover rpmsg offchannel deadcoding
From: "Dr. David Alan Gilbert" <[email protected]>
Hi,
This removes a couple of unused functions in rpmsg,
and (v2) after discussions with Arnaud, follows the thread and removes code that they would call.
(Build tested only)
V3
Fixup comment on rpmsg_send_offchannel_raw(), removing the reference to "_offchannel" - as per Mathieu's review
Dr. David Alan Gilbert (3):
rpmsg: core: Remove deadcode
rpmsg: virtio: Remove uncallable offchannel functions
rpmsg: Remove unused method pointers *send_offchannel
Documentation/staging/rpmsg.rst | 46 ----------------------- drivers/rpmsg/rpmsg_core.c | 63 -------------------------------- drivers/rpmsg/rpmsg_internal.h | 6 --- drivers/rpmsg/virtio_rpmsg_bus.c | 24 +----------- include/linux/rpmsg.h | 22 ----------- 5 files changed, 1 insertion(+), 160 deletions(-)
Signature · 1 line
2.49.0
PATCH v3 1/3 rpmsg: core: Remove deadcode
From: "Dr. David Alan Gilbert" <[email protected]>
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.
--- Documentation/staging/rpmsg.rst | 46 ------------------------ drivers/rpmsg/rpmsg_core.c | 63 --------------------------------- include/linux/rpmsg.h | 22 ------------ 3 files changed, 131 deletions(-)
Documentation/staging/rpmsg.rst +0 -46
@@ -110,31 +110,6 @@ or a timeout of 15 seconds elapses. When the latter happens, The function can only be called from a process context (for now). Returns 0 on success and an appropriate error value on failure. -:: - - int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, - void *data, int len); - - -sends a message across to the remote processor, using the src and dst -addresses provided by the user. - -The caller should specify the endpoint, the data it wants to send, -its length (in bytes), and explicit source and destination addresses. -The message will then be sent to the remote processor to which the -endpoint's channel belongs, but the endpoint's src and channel dst -addresses will be ignored (and the user-provided addresses will -be used instead). - -In case there are no TX buffers available, the function will block until -one becomes available (i.e. until the remote processor consumes -a tx buffer and puts it back on virtio's used descriptor ring), -or a timeout of 15 seconds elapses. When the latter happens, --ERESTARTSYS is returned. - -The function can only be called from a process context (for now). -Returns 0 on success and an appropriate error value on failure. - :: int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len);
@@ -173,27 +148,6 @@ return -ENOMEM without waiting until one becomes available. The function can only be called from a process context (for now). Returns 0 on success and an appropriate error value on failure. -:: - - int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, - void *data, int len); - - -sends a message across to the remote processor, using source and -destination addresses provided by the user. - -The user should specify the channel, the data it wants to send, -its length (in bytes), and explicit source and destination addresses. -The message will then be sent to the remote processor to which the -channel belongs, but the channel's src and dst addresses will be -ignored (and the user-provided addresses will be used instead). - -In case there are no TX buffers available, the function will immediately -return -ENOMEM without waiting until one becomes available. - -The function can only be called from a process context (for now). -Returns 0 on success and an appropriate error value on failure. - :: struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *rpdev,
drivers/rpmsg/rpmsg_core.c +0 -63
75 lines not on this page · raw message
include/linux/rpmsg.h +0 -22
@@ -184,13 +184,9 @@ struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *,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_offchannel (struct rpmsg_endpoint *ept,u32 src,u32 dst, -void *data,int len);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_offchannel (struct rpmsg_endpoint *ept,u32 src,u32 dst, -void *data,int len);__poll_t rpmsg_poll (struct rpmsg_endpoint *ept,struct file *filp,poll_table *wait);
@@ -271,15 +267,6 @@ static inline int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len, } -static inline int rpmsg_send_offchannel (struct rpmsg_endpoint *ept,u32 src, -u32 dst,void *data,int len) -{ -/* This shouldn't be possible */ -WARN_ON (1 ); - -return -ENXIO ; -} -static inline int rpmsg_trysend (struct rpmsg_endpoint *ept,void *data,int len) {/* This shouldn't be possible */
@@ -297,15 +284,6 @@ static inline int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data,return -ENXIO ; } -static inline int rpmsg_trysend_offchannel (struct rpmsg_endpoint *ept,u32 src, -u32 dst,void *data,int len) -{ -/* This shouldn't be possible */ -WARN_ON (1 ); - -return -ENXIO ; -} -static inline __poll_t rpmsg_poll (struct rpmsg_endpoint *ept,struct file *filp,poll_table *wait) {
Signature · 1 line
2.49.0
PATCH v3 2/3 rpmsg: virtio: Remove uncallable offchannel functions
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
The virtio_rpmsg_send_offchannel() and virtio_rpmsg_trysend_offchannel() are wired up to the send_offchannel and trysend_offchannel members of rpmsg_endpoint_ops, the only dereference of those was by the unused, and now removed rpmsg_send_offchannel() and rpmsg_trysend_offchannel() functions.
Remove them.
--- drivers/rpmsg/virtio_rpmsg_bus.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-)
drivers/rpmsg/virtio_rpmsg_bus.c +1 -23
@@ -141,13 +141,9 @@ 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_send_offchannel (struct rpmsg_endpoint *ept,u32 src, -u32 dst,void *data,int len);static int virtio_rpmsg_trysend (struct rpmsg_endpoint *ept,void *data,int len);static int virtio_rpmsg_trysendto (struct rpmsg_endpoint *ept,void *data,int len,u32 dst); -static int virtio_rpmsg_trysend_offchannel (struct rpmsg_endpoint *ept,u32 src, -u32 dst,void *data,int len);static ssize_t virtio_rpmsg_get_mtu (struct rpmsg_endpoint *ept);static struct rpmsg_device *__rpmsg_create_channel (struct virtproc_info *vrp,struct rpmsg_channel_info *chinfo);
@@ -156,10 +152,8 @@ static const struct rpmsg_endpoint_ops virtio_endpoint_ops = { .destroy_ept = virtio_rpmsg_destroy_ept, .send = virtio_rpmsg_send, .sendto = virtio_rpmsg_sendto, - .send_offchannel = virtio_rpmsg_send_offchannel, .trysend = virtio_rpmsg_trysend, .trysendto = virtio_rpmsg_trysendto, - .trysend_offchannel = virtio_rpmsg_trysend_offchannel, .get_mtu = virtio_rpmsg_get_mtu, };
@@ -545,7 +539,7 @@ static void rpmsg_downref_sleepers(struct virtproc_info *vrp)* the function will immediately fail, and -ENOMEM will be returned. * * Normally drivers shouldn't use this function directly; instead, drivers -* should use the appropriate rpmsg_{try}send{to, _offchannel} API +* should use the appropriate rpmsg_{try}send{to} API * (see include/linux/rpmsg.h). * * Return: 0 on success and an appropriate error value on failure.
@@ -665,14 +659,6 @@ 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_send_offchannel (struct rpmsg_endpoint *ept,u32 src, -u32 dst,void *data,int len) -{ -struct rpmsg_device *rpdev = ept->rpdev; - -return rpmsg_send_offchannel_raw (rpdev, src, dst, data, len, true); -} -static int virtio_rpmsg_trysend (struct rpmsg_endpoint *ept,void *data,int len) {struct rpmsg_device *rpdev = ept->rpdev;
@@ -690,14 +676,6 @@ static int virtio_rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data,return rpmsg_send_offchannel_raw (rpdev, src, dst, data, len, false); } -static int virtio_rpmsg_trysend_offchannel (struct rpmsg_endpoint *ept,u32 src, -u32 dst,void *data,int len) -{ -struct rpmsg_device *rpdev = ept->rpdev; - -return rpmsg_send_offchannel_raw (rpdev, src, dst, data, len, false); -} -static ssize_t virtio_rpmsg_get_mtu (struct rpmsg_endpoint *ept) {struct rpmsg_device *rpdev = ept->rpdev;
Signature · 1 line
2.49.0
PATCH v3 3/3 rpmsg: Remove unused method pointers *send_offchannel
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
After the previous patch, there are no implementers of the send_offchannel() and trysend_offchannel() methods.
Remove them.
--- drivers/rpmsg/rpmsg_internal.h | 6 ------ 1 file changed, 6 deletions(-)
drivers/rpmsg/rpmsg_internal.h +0 -6
@@ -50,10 +50,8 @@ struct rpmsg_device_ops {* @destroy_ept: see @rpmsg_destroy_ept(), required * @send: see @rpmsg_send(), required * @sendto: see @rpmsg_sendto(), optional -* @send_offchannel: see @rpmsg_send_offchannel(), optional * @trysend: see @rpmsg_trysend(), required * @trysendto: see @rpmsg_trysendto(), optional -* @trysend_offchannel: see @rpmsg_trysend_offchannel(), optional * @poll: see @rpmsg_poll(), optional * @set_flow_control: see @rpmsg_set_flow_control(), optional * @get_mtu: see @rpmsg_get_mtu(), optional
@@ -67,13 +65,9 @@ struct rpmsg_endpoint_ops {int (*send)(struct rpmsg_endpoint *ept,void *data,int len);int (*sendto)(struct rpmsg_endpoint *ept,void *data,int len,u32 dst); -int (*send_offchannel)(struct rpmsg_endpoint *ept,u32 src,u32 dst, -void *data,int len);int (*trysend)(struct rpmsg_endpoint *ept,void *data,int len);int (*trysendto)(struct rpmsg_endpoint *ept,void *data,int len,u32 dst); -int (*trysend_offchannel)(struct rpmsg_endpoint *ept,u32 src,u32 dst, -void *data,int len);__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);
Signature · 1 line
2.49.0
Quoted 6 lines · On 4/30/25 01:45, [email protected] wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
Hi,
This removes a couple of unused functions in rpmsg,
and (v2) after discussions with Arnaud, follows the thread and removes code that they would call.
Thanks,
Arnaud
Quoted 22 lines
(Build tested only)
Signed-off-by Dr. David Alan Gilbert <[email protected]>V3
Fixup comment onrpmsg_send_offchannel_raw(), removing the reference to "_offchannel" - as per Mathieu's reviewDr. David Alan Gilbert (3):
rpmsg: core: Remove deadcode
rpmsg: virtio: Remove uncallable offchannel functions
rpmsg: Remove unused method pointers*send_offchannelDocumentation/staging/rpmsg.rst | 46 ----------------------- drivers/rpmsg/rpmsg_core.c | 63 -------------------------------- drivers/rpmsg/rpmsg_internal.h | 6 --- drivers/rpmsg/virtio_rpmsg_bus.c | 24 +----------- include/linux/rpmsg.h | 22 ----------- 5 files changed, 1 insertion(+), 160 deletions(-)
Mathieu Poirier
maintainerQuoted 21 lines · On Wed, Apr 30, 2025 at 12:45:56AM +0100, [email protected] wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
Hi,
This removes a couple of unused functions in rpmsg,
and (v2) after discussions with Arnaud, follows the thread and removes code that they would call.(Build tested only)
Signed-off-by Dr. David Alan Gilbert <[email protected]>V3
Fixup comment onrpmsg_send_offchannel_raw(), removing the reference to "_offchannel" - as per Mathieu's reviewDr. David Alan Gilbert (3):
rpmsg: core: Remove deadcode
rpmsg: virtio: Remove uncallable offchannel functions
rpmsg: Remove unused method pointers*send_offchannel
Quoted 6 lines
Documentation/staging/rpmsg.rst | 46 ----------------------- drivers/rpmsg/rpmsg_core.c | 63 -------------------------------- drivers/rpmsg/rpmsg_internal.h | 6 --- drivers/rpmsg/virtio_rpmsg_bus.c | 24 +----------- include/linux/rpmsg.h | 22 ----------- 5 files changed, 1 insertion(+), 160 deletions(-)
I have applied this patchet.
Thanks,
Mathieu
Quoted 4 lines
Signature · 2 lines
-- 2.49.0
Quoted 22 lines · * Mathieu Poirier ([email protected]) wrote:
Quoted 21 lines · On Wed, Apr 30, 2025 at 12:45:56AM +0100, [email protected] wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
Hi,
This removes a couple of unused functions in rpmsg,
and (v2) after discussions with Arnaud, follows the thread and removes code that they would call.(Build tested only)
Signed-off-by Dr. David Alan Gilbert <[email protected]>V3
Fixup comment onrpmsg_send_offchannel_raw(), removing the reference to "_offchannel" - as per Mathieu's reviewDr. David Alan Gilbert (3):
rpmsg: core: Remove deadcode
rpmsg: virtio: Remove uncallable offchannel functions
rpmsg: Remove unused method pointers*send_offchannel
Quoted 8 lines
Quoted 6 lines
Documentation/staging/rpmsg.rst | 46 ----------------------- drivers/rpmsg/rpmsg_core.c | 63 -------------------------------- drivers/rpmsg/rpmsg_internal.h | 6 --- drivers/rpmsg/virtio_rpmsg_bus.c | 24 +----------- include/linux/rpmsg.h | 22 ----------- 5 files changed, 1 insertion(+), 160 deletions(-)I have applied this patchet.
Thanks!
Dave
Quoted 8 lines
Thanks,
MathieuQuoted 4 lines
Signature · 2 lines
-- 2.49.0
Signature · 4 lines
-----Open up your eyes, open up your mind, open up your code ------- / Dr. David Alan Gilbert | Running GNU/Linux | Happy \ \ dave @ treblig.org | | In Hex / \ _________________________|_____ http://www.treblig.org |_______/