Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 May 2004 16:59:37 +0400
From:      Gleb Smirnoff <glebius@cell.sick.ru>
To:        sam@freebsd.org, rwatson@freebsd.org
Cc:        current@freebsd.org
Subject:   m_tag_init() unused
Message-ID:  <20040518125937.GA67993@cell.sick.ru>

next in thread | raw e-mail | index | archive | help

--k+w/mQv8wyuph6w0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline

  Dear sirs,

  browsing mbuf code I have found, that m_tag_init() is never used within
the source tree. I have also noted, that there is m_tag_setup() with the
following comment:

 * XXX probably should be called m_tag_init; but that was
 * already taken.

Attached patches remove m_tag_init(), rename m_tag_setup() to
m_tag_init(), and fix the only call to m_tag_setup().

I've tested them by rebuilding kernel and performing some network activity
on divert socket.

-- 
Totus tuus, Glebius.
GLEBIUS-RIPN GLEB-RIPE

--k+w/mQv8wyuph6w0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: attachment; filename="mbuf.h.diff"

Index: mbuf.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/mbuf.h,v
retrieving revision 1.143
diff -u -r1.143 mbuf.h
--- mbuf.h	2 May 2004 15:10:17 -0000	1.143
+++ mbuf.h	18 May 2004 12:00:31 -0000
@@ -564,23 +564,11 @@
 void		 m_tag_delete_nonpersistent(struct mbuf *);
 
 /*
- * Initialize the list of tags associated with an mbuf.
- */
-static __inline void
-m_tag_init(struct mbuf *m)
-{
-	SLIST_INIT(&m->m_pkthdr.tags);
-}
-
-/*
  * Setup the contents of a tag.  Note that this does not
  * fillin the free method; the caller is expected to do that.
- *
- * XXX probably should be called m_tag_init; but that was
- * already taken.
  */
 static __inline void
-m_tag_setup(struct m_tag *t, u_int32_t cookie, int type, int len)
+m_tag_init(struct m_tag *t, u_int32_t cookie, int type, int len)
 {
 	t->m_tag_id = type;
 	t->m_tag_len = len;

--k+w/mQv8wyuph6w0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: attachment; filename="uipc_mbuf2.c.diff"

Index: uipc_mbuf2.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/uipc_mbuf2.c,v
retrieving revision 1.24
diff -u -r1.24 uipc_mbuf2.c
--- uipc_mbuf2.c	9 May 2004 05:57:58 -0000	1.24
+++ uipc_mbuf2.c	18 May 2004 12:00:06 -0000
@@ -329,7 +329,7 @@
 	t = malloc(len + sizeof(struct m_tag), M_PACKET_TAGS, wait);
 	if (t == NULL)
 		return NULL;
-	m_tag_setup(t, cookie, type, len);
+	m_tag_init(t, cookie, type, len);
 	t->m_tag_free = _m_tag_free;
 	return t;
 }

--k+w/mQv8wyuph6w0--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040518125937.GA67993>