Module Name:    src
Committed By:   maxv
Date:           Wed Mar 21 17:03:09 UTC 2018

Modified Files:
        src/sys/kern: uipc_mbuf.c
        src/sys/sys: mbuf.h

Log Message:
Localify and remove unused prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/sys/kern/uipc_mbuf.c
cvs rdiff -u -r1.179 -r1.180 src/sys/sys/mbuf.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/uipc_mbuf.c
diff -u src/sys/kern/uipc_mbuf.c:1.183 src/sys/kern/uipc_mbuf.c:1.184
--- src/sys/kern/uipc_mbuf.c:1.183	Wed Mar 21 16:26:04 2018
+++ src/sys/kern/uipc_mbuf.c	Wed Mar 21 17:03:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.183 2018/03/21 16:26:04 maxv Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.184 2018/03/21 17:03:09 maxv Exp $	*/
 
 /*
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.183 2018/03/21 16:26:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.184 2018/03/21 17:03:09 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -606,7 +606,14 @@ m_get(int nowait, int type)
 
 	mbstat_type_add(type, 1);
 
-	m_hdr_init(m, type, NULL, m->m_dat, 0);
+	mowner_init(m, type);
+	m->m_ext_ref = m; /* default */
+	m->m_type = type;
+	m->m_len = 0;
+	m->m_next = NULL;
+	m->m_nextpkt = NULL; /* default */
+	m->m_data = m->m_dat;
+	m->m_flags = 0; /* default */
 
 	return m;
 }
@@ -620,7 +627,18 @@ m_gethdr(int nowait, int type)
 	if (m == NULL)
 		return NULL;
 
-	m_pkthdr_init(m);
+	m->m_data = m->m_pktdat;
+	m->m_flags = M_PKTHDR;
+
+	m_reset_rcvif(m);
+	m->m_pkthdr.len = 0;
+	m->m_pkthdr.csum_flags = 0;
+	m->m_pkthdr.csum_data = 0;
+	SLIST_INIT(&m->m_pkthdr.tags);
+
+	m->m_pkthdr.pattr_class = NULL;
+	m->m_pkthdr.pattr_af = AF_UNSPEC;
+	m->m_pkthdr.pattr_hdr = NULL;
 
 	return m;
 }

Index: src/sys/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.179 src/sys/sys/mbuf.h:1.180
--- src/sys/sys/mbuf.h:1.179	Fri Mar  9 11:57:38 2018
+++ src/sys/sys/mbuf.h	Wed Mar 21 17:03:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.179 2018/03/09 11:57:38 maxv Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.180 2018/03/21 17:03:09 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -200,10 +200,7 @@ struct pkthdr {
 	void	*pattr_hdr;		/* ALTQ: saved header position in mbuf */
 };
 
-/*
- * Note: These bits are carefully arranged so that the compiler can have
- * a prayer of generating a jump table.
- */
+/* Checksumming flags. */
 #define	M_CSUM_TCPv4		0x00000001	/* TCP header/payload */
 #define	M_CSUM_UDPv4		0x00000002	/* UDP header/payload */
 #define	M_CSUM_TCP_UDP_BAD	0x00000004	/* TCP/UDP checksum bad */
@@ -365,7 +362,6 @@ MBUF_DEFINE(mbuf, MHLEN, MLEN);
 #define	M_LINK0		0x00001000	/* link layer specific flag */
 #define	M_LINK1		0x00002000	/* link layer specific flag */
 #define	M_LINK2		0x00004000	/* link layer specific flag */
-
 #define	M_LINK3		0x00008000	/* link layer specific flag */
 #define	M_LINK4		0x00010000	/* link layer specific flag */
 #define	M_LINK5		0x00020000	/* link layer specific flag */
@@ -859,7 +855,6 @@ int	m_apply(struct mbuf *, int, int,
     int (*)(void *, void *, unsigned int), void *);
 void	m_cat(struct mbuf *,struct mbuf *);
 void	m_clget(struct mbuf *, int);
-int	m_mballoc(int, int);
 void	m_copyback(struct mbuf *, int, int, const void *);
 struct	mbuf *m_copyback_cow(struct mbuf *, int, int, const void *, int);
 int	m_makewritable(struct mbuf **, int, int, int);
@@ -870,7 +865,6 @@ void	m_freem(struct mbuf *);
 void	m_reclaim(void *, int);
 void	mbinit(void);
 void	m_ext_free(struct mbuf *);
-char *	m_mapin(struct mbuf *);
 void	m_move_pkthdr(struct mbuf *, struct mbuf *);
 
 bool	m_ensure_contig(struct mbuf **, int);
@@ -933,22 +927,6 @@ m_length(const struct mbuf *m)
 }
 
 static __inline void
-m_hdr_init(struct mbuf *m, short type, struct mbuf *next, char *data, int len)
-{
-
-	KASSERT(m != NULL);
-
-	mowner_init(m, type);
-	m->m_ext_ref = m; /* default */
-	m->m_type = type;
-	m->m_len = len;
-	m->m_next = next;
-	m->m_nextpkt = NULL; /* default */
-	m->m_data = data;
-	m->m_flags = 0; /* default */
-}
-
-static __inline void
 m_set_rcvif(struct mbuf *m, const struct ifnet *ifp)
 {
 
@@ -971,26 +949,6 @@ m_copy_rcvif(struct mbuf *m, const struc
 	m->m_pkthdr.rcvif_index = n->m_pkthdr.rcvif_index;
 }
 
-static __inline void
-m_pkthdr_init(struct mbuf *m)
-{
-
-	KASSERT(m != NULL);
-
-	m->m_data = m->m_pktdat;
-	m->m_flags = M_PKTHDR;
-
-	m_reset_rcvif(m);
-	m->m_pkthdr.len = 0;
-	m->m_pkthdr.csum_flags = 0;
-	m->m_pkthdr.csum_data = 0;
-	SLIST_INIT(&m->m_pkthdr.tags);
-
-	m->m_pkthdr.pattr_class = NULL;
-	m->m_pkthdr.pattr_af = AF_UNSPEC;
-	m->m_pkthdr.pattr_hdr = NULL;
-}
-
 void m_print(const struct mbuf *, const char *, void (*)(const char *, ...)
     __printflike(1, 2));
 

Reply via email to