From 72821a502f073006643cb4ef7815fc8c42563ce6 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Thu, 29 Oct 2020 17:20:12 +0100 Subject: [PATCH 1/2] gnrc_pktbuf: drop gnrc_pktbuf_replace_snip() The function was deprecated in e94aa40bf5637076874bf85fbaa7fcd51892aa32 and is unused and untested in the current code base. --- sys/include/net/gnrc/pktbuf.h | 17 ----------------- sys/net/gnrc/pktbuf/gnrc_pktbuf.c | 25 ------------------------- 2 files changed, 42 deletions(-) diff --git a/sys/include/net/gnrc/pktbuf.h b/sys/include/net/gnrc/pktbuf.h index bca3af7299..2eb51b89d7 100644 --- a/sys/include/net/gnrc/pktbuf.h +++ b/sys/include/net/gnrc/pktbuf.h @@ -206,23 +206,6 @@ gnrc_pktsnip_t *gnrc_pktbuf_start_write(gnrc_pktsnip_t *pkt); */ gnrc_pktsnip_t *gnrc_pktbuf_remove_snip(gnrc_pktsnip_t *pkt, gnrc_pktsnip_t *snip); -/** - * @brief Replace a snip from a packet and the packet buffer by another snip. - * - * @deprecated Function is not used by anyone (not even tested, see - * https://github.com/RIOT-OS/RIOT/issues/5089). Will be removed - * after 2020.10 release. - * - * @param[in] pkt A packet - * @param[in] old snip currently in the packet - * @param[in] add snip which will replace old - * - * @return The new reference to @p pkt - */ -gnrc_pktsnip_t *gnrc_pktbuf_replace_snip(gnrc_pktsnip_t *pkt, - gnrc_pktsnip_t *old, - gnrc_pktsnip_t *add); - /** * @brief Reverses snip order of a packet in a write-protected manner. * diff --git a/sys/net/gnrc/pktbuf/gnrc_pktbuf.c b/sys/net/gnrc/pktbuf/gnrc_pktbuf.c index 6c285f3a97..bfa0d40c41 100644 --- a/sys/net/gnrc/pktbuf/gnrc_pktbuf.c +++ b/sys/net/gnrc/pktbuf/gnrc_pktbuf.c @@ -25,31 +25,6 @@ gnrc_pktsnip_t *gnrc_pktbuf_remove_snip(gnrc_pktsnip_t *pkt, return pkt; } -gnrc_pktsnip_t *gnrc_pktbuf_replace_snip(gnrc_pktsnip_t *pkt, - gnrc_pktsnip_t *old, - gnrc_pktsnip_t *add) -{ - /* If add is a list we need to preserve its tail */ - if (add->next != NULL) { - gnrc_pktsnip_t *tail = add->next; - /* find the last snip in tail */ - gnrc_pktsnip_t *back = gnrc_pkt_prev_snip(tail, NULL); - /* Replace old */ - LL_REPLACE_ELEM(pkt, old, add); - /* and wire in the tail between */ - back->next = add->next; - add->next = tail; - } - else { - /* add is a single element, has no tail, simply replace */ - LL_REPLACE_ELEM(pkt, old, add); - } - old->next = NULL; - gnrc_pktbuf_release(old); - - return pkt; -} - gnrc_pktsnip_t *gnrc_pktbuf_reverse_snips(gnrc_pktsnip_t *pkt) { gnrc_pktsnip_t *reversed = NULL, *ptr = pkt; From 3316ca73e3277fdd2f7d8301b3f2887e7333363a Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Thu, 29 Oct 2020 17:25:32 +0100 Subject: [PATCH 2/2] LOSTANDFOUND.md: update for gnrc_pktbuf_replace_snip() removal --- LOSTANDFOUND.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/LOSTANDFOUND.md b/LOSTANDFOUND.md index 433e9b427a..d408ec5f15 100644 --- a/LOSTANDFOUND.md +++ b/LOSTANDFOUND.md @@ -235,6 +235,16 @@ Author(s): Reason for removal: - Outdated, unmaintained and no longer working +### gnrc_pktbuf_replace_snip() [72821a502f073006643cb4ef7815fc8c42563ce6] + +Author(s): +- Joakim NohlgÄrd +- Martine S. Lenders + +Reason for removal: +- Unused, untested and no longer needed + + [cdc252ab7bd4161cc046bf93a3e55995704b24d4]: https://github.com/RIOT-OS/RIOT/commit/cdc252ab7bd4161cc046bf93a3e55995704b24d4 [ed3887ac5c1e95308c2827bce3cdca8b0f146c22]: https://github.com/RIOT-OS/RIOT/commit/ed3887ac5c1e95308c2827bce3cdca8b0f146c22 [0e2a62078850e1ecc74db2db4d639cf2d8fb96d3]: https://github.com/RIOT-OS/RIOT/commit/0e2a62078850e1ecc74db2db4d639cf2d8fb96d3 @@ -259,3 +269,4 @@ Reason for removal: [3cac6e0979468ba56659291fd1cd11096611589d]: https://github.com/RIOT-OS/RIOT/commit/3cac6e0979468ba56659291fd1cd11096611589d [9fb2f541baca469e34fa01b004d6f19385700ce9]: https://github.com/RIOT-OS/RIOT/commit/9fb2f541baca469e34fa01b004d6f19385700ce9 [35b6ccedf31f10a5f8e4f97609ad5b10c28bdc34]: https://github.com/RIOT-OS/RIOT/commit/35b6ccedf31f10a5f8e4f97609ad5b10c28bdc34 +[72821a502f073006643cb4ef7815fc8c42563ce6]: https://github.com/RIOT-OS/RIOT/commit/72821a502f073006643cb4ef7815fc8c42563ce6