diff mbox

[ovs-dev] dp-packet: remove unused helper dp_packet_to_string()

Message ID 1452488439-26586-1-git-send-email-simon.horman@netronome.com
State Accepted
Headers show

Commit Message

Simon Horman Jan. 11, 2016, 5 a.m. UTC
dp_packet_to_string() does not appear to be used.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
 lib/dp-packet.c | 15 ---------------
 lib/dp-packet.h |  1 -
 2 files changed, 16 deletions(-)

Comments

Ben Pfaff Jan. 11, 2016, 11:13 p.m. UTC | #1
On Mon, Jan 11, 2016 at 02:00:39PM +0900, Simon Horman wrote:
> dp_packet_to_string() does not appear to be used.
> 
> Signed-off-by: Simon Horman <simon.horman@netronome.com>

I assume this was meant for use during debugging but even then it seems
like it has limited usefulness.

Applied to master, thanks.
diff mbox

Patch

diff --git a/lib/dp-packet.c b/lib/dp-packet.c
index 1d166e15cf6c..db3c857aebf6 100644
--- a/lib/dp-packet.c
+++ b/lib/dp-packet.c
@@ -431,21 +431,6 @@  dp_packet_steal_data(struct dp_packet *b)
     return p;
 }
 
-/* Returns a string that describes some of 'b''s metadata plus a hex dump of up
- * to 'maxbytes' from the start of the buffer. */
-char *
-dp_packet_to_string(const struct dp_packet *b, size_t maxbytes)
-{
-    struct ds s;
-
-    ds_init(&s);
-    ds_put_format(&s, "size=%"PRIu32", allocated=%"PRIu32", head=%"PRIuSIZE", tail=%"PRIuSIZE"\n",
-                  dp_packet_size(b), dp_packet_get_allocated(b),
-                  dp_packet_headroom(b), dp_packet_tailroom(b));
-    ds_put_hex_dump(&s, dp_packet_data(b), MIN(dp_packet_size(b), maxbytes), 0, false);
-    return ds_cstr(&s);
-}
-
 static inline void
 dp_packet_adjust_layer_offset(uint16_t *offset, int increment)
 {
diff --git a/lib/dp-packet.h b/lib/dp-packet.h
index 5044ce0e3b6c..bf4e7581cab3 100644
--- a/lib/dp-packet.h
+++ b/lib/dp-packet.h
@@ -140,7 +140,6 @@  static inline void *dp_packet_try_pull(struct dp_packet *, size_t);
 
 void *dp_packet_steal_data(struct dp_packet *);
 
-char *dp_packet_to_string(const struct dp_packet *, size_t maxbytes);
 static inline bool dp_packet_equal(const struct dp_packet *,
                                    const struct dp_packet *);