From b4b12e52fb02dfe381fe328b98511aa2087ca619 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Wed, 10 Feb 2016 18:54:18 +0000 Subject: [PATCH] Garbage collect unused arguments of m_init(). --- sys/dev/cxgb/cxgb_sge.c | 8 +++----- sys/dev/cxgbe/t4_sge.c | 2 +- sys/kern/kern_mbuf.c | 4 ++-- sys/netinet/tcp_pcap.c | 2 +- sys/sys/mbuf.h | 3 +-- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 2cfad262673b..a622fcfef566 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -795,12 +795,10 @@ free_rx_bufs(adapter_t *sc, struct sge_fl *q) bus_dmamap_unload(q->entry_tag, d->map); bus_dmamap_destroy(q->entry_tag, d->map); if (q->zone == zone_pack) { - m_init(d->m, zone_pack, MCLBYTES, - M_NOWAIT, MT_DATA, M_EXT); + m_init(d->m, M_NOWAIT, MT_DATA, M_EXT); uma_zfree(zone_pack, d->m); } else { - m_init(d->m, zone_mbuf, MLEN, - M_NOWAIT, MT_DATA, 0); + m_init(d->m, M_NOWAIT, MT_DATA, 0); uma_zfree(zone_mbuf, d->m); uma_zfree(q->zone, d->rxsd_cl); } @@ -2725,7 +2723,7 @@ get_packet(adapter_t *adap, unsigned int drop_thres, struct sge_qset *qs, if ((sopeop == RSPQ_SOP_EOP) || (sopeop == RSPQ_SOP)) flags |= M_PKTHDR; - m_init(m, fl->zone, fl->buf_size, M_NOWAIT, MT_DATA, flags); + m_init(m, M_NOWAIT, MT_DATA, flags); if (fl->zone == zone_pack) { /* * restore clobbered data pointer diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index b43cd5fdf108..0c3644d98afc 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -1570,7 +1570,7 @@ get_scatter_segment(struct adapter *sc, struct sge_fl *fl, int fr_offset, MPASS(clm != NULL); m = (struct mbuf *)(sd->cl + sd->nmbuf * MSIZE); /* No bzero required */ - if (m_init(m, NULL, 0, M_NOWAIT, MT_DATA, + if (m_init(m, M_NOWAIT, MT_DATA, fr_offset == 0 ? M_PKTHDR | M_NOFREE : M_NOFREE)) return (NULL); fl->mbuf_inlined++; diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 55964398b6a1..148b52f8b9df 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -435,7 +435,7 @@ mb_ctor_mbuf(void *mem, int size, void *arg, int how) m = (struct mbuf *)mem; flags = args->flags; - error = m_init(m, NULL, size, how, type, flags); + error = m_init(m, how, type, flags); return (error); } @@ -635,7 +635,7 @@ mb_ctor_pack(void *mem, int size, void *arg, int how) trash_ctor(m->m_ext.ext_buf, MCLBYTES, arg, how); #endif - error = m_init(m, NULL, size, how, type, flags); + error = m_init(m, how, type, flags); /* m_ext is already initialized. */ m->m_data = m->m_ext.ext_buf; diff --git a/sys/netinet/tcp_pcap.c b/sys/netinet/tcp_pcap.c index f0c651dab555..41a7fbfc958d 100644 --- a/sys/netinet/tcp_pcap.c +++ b/sys/netinet/tcp_pcap.c @@ -341,7 +341,7 @@ tcp_pcap_add(struct tcphdr *th, struct mbuf *m, struct mbufq *queue) n = mhead; tcp_pcap_m_freem(n->m_next); - m_init(n, NULL, 0, M_NOWAIT, MT_DATA, 0); + m_init(n, M_NOWAIT, MT_DATA, 0); } } diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index a4aa0bcf86bf..8d35f33b12f4 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -618,8 +618,7 @@ m_getzone(int size) * should go away with constant propagation for !MGETHDR. */ static __inline int -m_init(struct mbuf *m, uma_zone_t zone __unused, int size __unused, int how, - short type, int flags) +m_init(struct mbuf *m, int how, short type, int flags) { int error;