aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/sysctl.h
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2016-03-14 20:34:30 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2016-03-14 20:34:30 +0000
commitd6231037df56d013e3ce923560ad44d77d5d2ae7 (patch)
tree6def26785fac7c38768204da379cbf4c637b88b5 /sys/sys/sysctl.h
parent94e900c6cdb08e41336a9c125feadf2f38a4e7a5 (diff)
downloadsrc-d6231037df56d013e3ce923560ad44d77d5d2ae7.tar.gz
src-d6231037df56d013e3ce923560ad44d77d5d2ae7.zip
Revert r296868. The cast is useful to protect against passing incorrect
argument type to the macro. Submitted by: rstone
Notes
Notes: svn path=/head/; revision=296871
Diffstat (limited to 'sys/sys/sysctl.h')
-rw-r--r--sys/sys/sysctl.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index 7c1e79cfb1fb..ec40d2955a32 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -640,11 +640,12 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
#define SYSCTL_ADD_COUNTER_U64(ctx, parent, nbr, name, access, ptr, descr) \
({ \
+ counter_u64_t *__ptr = (ptr); \
CTASSERT(((access) & CTLTYPE) == 0 || \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64); \
sysctl_add_oid(ctx, parent, nbr, name, \
CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \
- ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr)); \
+ __ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr)); \
})
/* Oid for an opaque object. Specified by a pointer and a length. */