diff options
author | ae <ae@FreeBSD.org> | 2010-06-15 08:53:13 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2010-06-15 08:53:13 +0000 |
commit | 6dd2af5a9596edb67e31f92c8e2c396b69aad6ba (patch) | |
tree | 780a95349a307dbf9165e77edb0baf78dde6c0eb /sys/netgraph | |
parent | b3f689911f5a6573e4b49b1c7f7d3d8587d4aae5 (diff) | |
download | FreeBSD-src-6dd2af5a9596edb67e31f92c8e2c396b69aad6ba.zip FreeBSD-src-6dd2af5a9596edb67e31f92c8e2c396b69aad6ba.tar.gz |
* 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)
Diffstat (limited to 'sys/netgraph')
-rw-r--r-- | sys/netgraph/ng_patch.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/netgraph/ng_patch.c b/sys/netgraph/ng_patch.c index 224c56c..5e1ea54 100644 --- a/sys/netgraph/ng_patch.c +++ b/sys/netgraph/ng_patch.c @@ -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_parse_type *type, 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); } |