svn commit: r209194 - head/sys/netgraph
Andrey V. Elsukov
ae at FreeBSD.org
Tue Jun 15 08:53:15 UTC 2010
Author: ae
Date: Tue Jun 15 08:53:13 2010
New Revision: 209194
URL: http://svn.freebsd.org/changeset/base/209194
Log:
* Include sys/systm.h for KASSERT()
* Remove unneeded includes and comment
* Replace home made OFFSETOF() macro with standard offsetof()
Pointed out by: bde
Approved by: kib (mentor)
Modified:
head/sys/netgraph/ng_patch.c
Modified: head/sys/netgraph/ng_patch.c
==============================================================================
--- head/sys/netgraph/ng_patch.c Tue Jun 15 07:06:54 2010 (r209193)
+++ head/sys/netgraph/ng_patch.c Tue Jun 15 08:53:13 2010 (r209194)
@@ -29,10 +29,9 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/kernel.h>
-#include <sys/ctype.h>
-#include <sys/endian.h> /* be64toh(), htobe64() */
-#include <sys/errno.h>
+#include <sys/endian.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <netgraph/ng_message.h>
@@ -47,8 +46,6 @@ static ng_newhook_t ng_patch_newhook;
static ng_rcvdata_t ng_patch_rcvdata;
static ng_disconnect_t ng_patch_disconnect;
-#define OFFSETOF(s, e) ((char *)&((s *)0)->e - (char *)((s *)0))
-
static int
ng_patch_config_getlen(const struct ng_parse_type *type,
const u_char *start, const u_char *buf)
@@ -56,7 +53,7 @@ ng_patch_config_getlen(const struct ng_p
const struct ng_patch_config *p;
p = (const struct ng_patch_config *)(buf -
- OFFSETOF(struct ng_patch_config, ops));
+ offsetof(struct ng_patch_config, ops));
return (p->count);
}
More information about the svn-src-head
mailing list