Skip to contentSkip to conversation

hw/net/net_rx_pkt: Remove deadcode

PATCH Applied [email protected] 5 participants 7 messages Sep 18, 2024 – Oct 9, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/net/net_rx_pkt: Remove deadcode

From: "Dr. David Alan Gilbert" <[email protected]>

net_rx_pkt_get_l3_hdr_offset and net_rx_pkt_get_iovec_len haven't been used since they were added.

Remove them.

---
 hw/net/net_rx_pkt.c | 13 -------------
 hw/net/net_rx_pkt.h |  9 ---------
 2 files changed, 22 deletions(-)
hw/net/net_rx_pkt.c +0 -13
index 32e5f3f9cf..cec1d0523d 100644
@@ -209,12 +209,6 @@ void net_rx_pkt_get_protocols(struct NetRxPkt *pkt,
     *l4hdr_proto = pkt->l4hdr_info.proto;
 }
 
-size_t net_rx_pkt_get_l3_hdr_offset(struct NetRxPkt *pkt)
-{
-    assert(pkt);
-    return pkt->l3hdr_off;
-}
-
 size_t net_rx_pkt_get_l4_hdr_offset(struct NetRxPkt *pkt)
 {
     assert(pkt);
@@ -427,13 +421,6 @@ struct iovec *net_rx_pkt_get_iovec(struct NetRxPkt *pkt)
     return pkt->vec;
 }
 
-uint16_t net_rx_pkt_get_iovec_len(struct NetRxPkt *pkt)
-{
-    assert(pkt);
-
-    return pkt->vec_len;
-}
-
 void net_rx_pkt_set_vhdr(struct NetRxPkt *pkt,
                             struct virtio_net_hdr *vhdr)
 {
hw/net/net_rx_pkt.h +0 -9
index 55ec67a1a7..e8df9cfd52 100644
@@ -267,15 +267,6 @@ net_rx_pkt_attach_data(struct NetRxPkt *pkt, const void *data,
  */
 struct iovec *net_rx_pkt_get_iovec(struct NetRxPkt *pkt);
 
-/**
-* returns io vector length that holds the attached data
-*
-* @pkt:            packet
-* @ret:            IOVec length
-*
-*/
-uint16_t net_rx_pkt_get_iovec_len(struct NetRxPkt *pkt);
-
 /**
  * prints rx packet data if debug is enabled
  *
Signature · 1 line
2.46.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 54 lines · On 19/09/2024 00.51, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

net_rx_pkt_get_l3_hdr_offset and net_rx_pkt_get_iovec_len haven't been used since they were added.

Remove them.

---
  hw/net/net_rx_pkt.c | 13 -------------
  hw/net/net_rx_pkt.h |  9 ---------
  2 files changed, 22 deletions(-)
hw/net/net_rx_pkt.c +0 -13
index 32e5f3f9cf..cec1d0523d 100644
@@ -209,12 +209,6 @@ void net_rx_pkt_get_protocols(struct NetRxPkt *pkt,
      *l4hdr_proto = pkt->l4hdr_info.proto;
  }
 
-size_t net_rx_pkt_get_l3_hdr_offset(struct NetRxPkt *pkt)
-{
-    assert(pkt);
-    return pkt->l3hdr_off;
-}
-
  size_t net_rx_pkt_get_l4_hdr_offset(struct NetRxPkt *pkt)
  {
      assert(pkt);
@@ -427,13 +421,6 @@ struct iovec *net_rx_pkt_get_iovec(struct NetRxPkt *pkt)
      return pkt->vec;
  }
 
-uint16_t net_rx_pkt_get_iovec_len(struct NetRxPkt *pkt)
-{
-    assert(pkt);
-
-    return pkt->vec_len;
-}
-
  void net_rx_pkt_set_vhdr(struct NetRxPkt *pkt,
                              struct virtio_net_hdr *vhdr)
  {
hw/net/net_rx_pkt.h +0 -2
index 55ec67a1a7..e8df9cfd52 100644
@@ -267,15 +267,6 @@ net_rx_pkt_attach_data(struct NetRxPkt *pkt, const void *data,
   */
  struct iovec *net_rx_pkt_get_iovec(struct NetRxPkt *pkt);
 
-/**
-* returns io vector length that holds the attached data

hw/net/net_rx_pkt.h net_rx_pkt_attach_data(struct NetRxPkt *pkt, const void *data, · line 272

Quoted 10 lines
hw/net/net_rx_pkt.h +0 -7
-*
-* @pkt:            packet
-* @ret:            IOVec length
-*
-*/
-uint16_t net_rx_pkt_get_iovec_len(struct NetRxPkt *pkt);
-
  /**
   * prints rx packet data if debug is enabled
   *
#2 lore raw
In reply to [email protected]
Quoted 4 lines · On 2024/09/19 7:51, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

net_rx_pkt_get_l3_hdr_offset and net_rx_pkt_get_iovec_len haven't been used since they were added.

You forgot to remove net_rx_pkt_get_l3_hdr_offset() from: hw/net/net_rx_pkt.h It looks good otherwise.

Regards,
Akihiko Odaki

Quoted 60 lines

Remove them.

---
  hw/net/net_rx_pkt.c | 13 -------------
  hw/net/net_rx_pkt.h |  9 ---------
  2 files changed, 22 deletions(-)
hw/net/net_rx_pkt.c +0 -13
index 32e5f3f9cf..cec1d0523d 100644
@@ -209,12 +209,6 @@ void net_rx_pkt_get_protocols(struct NetRxPkt *pkt,
      *l4hdr_proto = pkt->l4hdr_info.proto;
  }
 
-size_t net_rx_pkt_get_l3_hdr_offset(struct NetRxPkt *pkt)
-{
-    assert(pkt);
-    return pkt->l3hdr_off;
-}
-
  size_t net_rx_pkt_get_l4_hdr_offset(struct NetRxPkt *pkt)
  {
      assert(pkt);
@@ -427,13 +421,6 @@ struct iovec *net_rx_pkt_get_iovec(struct NetRxPkt *pkt)
      return pkt->vec;
  }
 
-uint16_t net_rx_pkt_get_iovec_len(struct NetRxPkt *pkt)
-{
-    assert(pkt);
-
-    return pkt->vec_len;
-}
-
  void net_rx_pkt_set_vhdr(struct NetRxPkt *pkt,
                              struct virtio_net_hdr *vhdr)
  {
hw/net/net_rx_pkt.h +0 -9
index 55ec67a1a7..e8df9cfd52 100644
@@ -267,15 +267,6 @@ net_rx_pkt_attach_data(struct NetRxPkt *pkt, const void *data,
   */
  struct iovec *net_rx_pkt_get_iovec(struct NetRxPkt *pkt);
 
-/**
-* returns io vector length that holds the attached data
-*
-* @pkt:            packet
-* @ret:            IOVec length
-*
-*/
-uint16_t net_rx_pkt_get_iovec_len(struct NetRxPkt *pkt);
-
  /**
   * prints rx packet data if debug is enabled
   *
#3 lore raw
In reply to [email protected]
Quoted 6 lines · 19.09.2024 01:51, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

net_rx_pkt_get_l3_hdr_offset and net_rx_pkt_get_iovec_len haven't been used since they were added.

Remove them.

Applied to the trivial-patches tree, removing net_rx_pkt_get_l3_hdr_offset() prototype from hw/net/net_rx_pkt.h in the process)

Thanks,

/mjt

#4 lore raw
Quoted 10 lines · * Michael Tokarev ([email protected]) wrote:
Quoted 6 lines · 19.09.2024 01:51, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

net_rx_pkt_get_l3_hdr_offset and net_rx_pkt_get_iovec_len haven't been used since they were added.

Remove them.

Applied to the trivial-patches tree, removing net_rx_pkt_get_l3_hdr_offset() prototype from hw/net/net_rx_pkt.h in the process)

Thanks, and to Akhiko for pointing out that header left over.

Dave

Quoted 3 lines

Thanks,

/mjt

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   |_______/
#6 lore raw
Quoted 1 line · Jason Wang

Queued.

Jason, please do a git pull first ;)

/mjt