Module Name:    src
Committed By:   maxv
Date:           Wed Feb 14 14:19:53 UTC 2018

Modified Files:
        src/sys/netipsec: ipsec.h ipsec_mbuf.c

Log Message:
Remove m_checkalignment(), unused. This eliminates a reference to
m_getptr().


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/netipsec/ipsec.h
cvs rdiff -u -r1.18 -r1.19 src/sys/netipsec/ipsec_mbuf.c

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

Modified files:

Index: src/sys/netipsec/ipsec.h
diff -u src/sys/netipsec/ipsec.h:1.62 src/sys/netipsec/ipsec.h:1.63
--- src/sys/netipsec/ipsec.h:1.62	Wed Jan 10 10:56:30 2018
+++ src/sys/netipsec/ipsec.h	Wed Feb 14 14:19:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.h,v 1.62 2018/01/10 10:56:30 knakahara Exp $	*/
+/*	$NetBSD: ipsec.h,v 1.63 2018/02/14 14:19:53 maxv Exp $	*/
 /*	$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.h,v 1.2.4.2 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: ipsec.h,v 1.53 2001/11/20 08:32:38 itojun Exp $	*/
 
@@ -356,7 +356,6 @@ int ipsec_process_done(struct mbuf *, co
 
 struct mbuf *ipsec_copypkt (struct mbuf *);
 
-void m_checkalignment(const char* , struct mbuf *, int, int);
 struct mbuf *m_clone(struct mbuf *);
 struct mbuf *m_makespace(struct mbuf *, int, int, int *);
 void *m_pad(struct mbuf *, int );

Index: src/sys/netipsec/ipsec_mbuf.c
diff -u src/sys/netipsec/ipsec_mbuf.c:1.18 src/sys/netipsec/ipsec_mbuf.c:1.19
--- src/sys/netipsec/ipsec_mbuf.c:1.18	Thu Feb  8 20:57:41 2018
+++ src/sys/netipsec/ipsec_mbuf.c	Wed Feb 14 14:19:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_mbuf.c,v 1.18 2018/02/08 20:57:41 maxv Exp $	*/
+/*	$NetBSD: ipsec_mbuf.c,v 1.19 2018/02/14 14:19:53 maxv Exp $	*/
 /*-
  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
  * All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsec_mbuf.c,v 1.18 2018/02/08 20:57:41 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_mbuf.c,v 1.19 2018/02/14 14:19:53 maxv Exp $");
 
 /*
  * IPsec-specific mbuf routines.
@@ -445,41 +445,3 @@ m_striphdr(struct mbuf *m, int skip, int
 	}
 	return (0);
 }
-
-/*
- * Diagnostic routine to check mbuf alignment as required by the
- * crypto device drivers (that use DMA).
- */
-void
-m_checkalignment(const char* where, struct mbuf *m0, int off, int len)
-{
-	int roff;
-	struct mbuf *m = m_getptr(m0, off, &roff);
-	void *addr;
-
-	if (m == NULL)
-		return;
-	printf("%s (off %u len %u): ", where, off, len);
-	addr = mtod(m, char *) + roff;
-	do {
-		int mlen;
-
-		if (((uintptr_t) addr) & 3) {
-			printf("addr misaligned %p,", addr);
-			break;
-		}
-		mlen = m->m_len;
-		if (mlen > len)
-			mlen = len;
-		len -= mlen;
-		if (len && (mlen & 3)) {
-			printf("len mismatch %u,", mlen);
-			break;
-		}
-		m = m->m_next;
-		addr = m ? mtod(m, void *) : NULL;
-	} while (m && len > 0);
-	for (m = m0; m; m = m->m_next)
-		printf(" [%p:%u]", mtod(m, void *), m->m_len);
-	printf("\n");
-}

Reply via email to