From owner-freebsd-current@FreeBSD.ORG Tue May 18 06:08:27 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B8B616A4E9; Tue, 18 May 2004 06:08:27 -0700 (PDT) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C93143D55; Tue, 18 May 2004 06:08:14 -0700 (PDT) (envelope-from glebius@cell.sick.ru) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.12.9/8.12.8) with ESMTP id i4ICxcvw068019 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 18 May 2004 16:59:38 +0400 (MSD) (envelope-from glebius@cell.sick.ru) Received: (from glebius@localhost) by cell.sick.ru (8.12.9/8.12.6/Submit) id i4ICxbBJ068018; Tue, 18 May 2004 16:59:37 +0400 (MSD) Date: Tue, 18 May 2004 16:59:37 +0400 From: Gleb Smirnoff To: sam@freebsd.org, rwatson@freebsd.org Message-ID: <20040518125937.GA67993@cell.sick.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline User-Agent: Mutt/1.5.6i cc: current@freebsd.org Subject: m_tag_init() unused X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2004 13:08:27 -0000 --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--