aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_sysctl.c4
-rw-r--r--sys/sys/sysctl.h28
2 files changed, 16 insertions, 16 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index f89aa0088b1f..8f30fed853db 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -312,7 +312,7 @@ sysctl_remove_oid(struct sysctl_oid *oidp, int del, int recurse)
sysctl_unregister_oid(oidp);
if (del) {
if (oidp->descr)
- free(oidp->descr, M_SYSCTLOID);
+ free((void *)(uintptr_t)(const void *)oidp->descr, M_SYSCTLOID);
free((void *)(uintptr_t)(const void *)oidp->oid_name,
M_SYSCTLOID);
free(oidp, M_SYSCTLOID);
@@ -377,7 +377,7 @@ sysctl_add_oid(struct sysctl_ctx_list *clist, struct sysctl_oid_list *parent,
int len = strlen(descr) + 1;
oidp->descr = malloc(len, M_SYSCTLOID, M_WAITOK);
if (oidp->descr)
- strcpy(oidp->descr, descr);
+ strcpy((char *)(uintptr_t)(const void *)oidp->descr, descr);
}
/* Update the context, if used */
if (clist != NULL)
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index da705b84920e..f9a7818b2413 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -133,14 +133,14 @@ struct sysctl_oid {
struct sysctl_oid_list *oid_parent;
SLIST_ENTRY(sysctl_oid) oid_link;
int oid_number;
- int oid_kind;
+ u_int oid_kind;
void *oid_arg1;
int oid_arg2;
const char *oid_name;
int (*oid_handler)(SYSCTL_HANDLER_ARGS);
const char *oid_fmt;
int oid_refcnt;
- char *descr;
+ const char *descr;
};
#define SYSCTL_IN(r, p, l) (r->newfunc)(r, p, l)
@@ -183,21 +183,21 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
static struct sysctl_oid sysctl__##parent##_##name = { \
&sysctl_##parent##_children, { 0 }, \
nbr, kind, a1, a2, #name, handler, fmt, 0, descr }; \
- DATA_SET(sysctl_set, sysctl__##parent##_##name);
+ DATA_SET(sysctl_set, sysctl__##parent##_##name)
#define SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
- sysctl_add_oid(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr);
+ sysctl_add_oid(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr)
/* This constructs a node from which other oids can hang. */
#define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \
struct sysctl_oid_list sysctl_##parent##_##name##_children; \
SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|access, \
(void*)&sysctl_##parent##_##name##_children, 0, handler, \
- "N", descr);
+ "N", descr)
#define SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr) \
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|access, \
- 0, 0, handler, "N", descr);
+ 0, 0, handler, "N", descr)
/* Oid for a string. len can be 0 to indicate '\0' termination. */
#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) \
@@ -206,7 +206,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
#define SYSCTL_ADD_STRING(ctx, parent, nbr, name, access, arg, len, descr) \
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_STRING|access, \
- arg, len, sysctl_handle_string, "A", descr);
+ arg, len, sysctl_handle_string, "A", descr)
/* Oid for an int. If ptr is NULL, val is returned. */
#define SYSCTL_INT(parent, nbr, name, access, ptr, val, descr) \
@@ -215,7 +215,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
#define SYSCTL_ADD_INT(ctx, parent, nbr, name, access, ptr, val, descr) \
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_INT|access, \
- ptr, val, sysctl_handle_int, "I", descr);
+ ptr, val, sysctl_handle_int, "I", descr)
/* Oid for an unsigned int. If ptr is NULL, val is returned. */
#define SYSCTL_UINT(parent, nbr, name, access, ptr, val, descr) \
@@ -224,7 +224,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
#define SYSCTL_ADD_UINT(ctx, parent, nbr, name, access, ptr, val, descr) \
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_UINT|access, \
- ptr, val, sysctl_handle_int, "IU", descr);
+ ptr, val, sysctl_handle_int, "IU", descr)
/* Oid for a long. The pointer must be non NULL. */
#define SYSCTL_LONG(parent, nbr, name, access, ptr, val, descr) \
@@ -233,7 +233,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
#define SYSCTL_ADD_LONG(ctx, parent, nbr, name, access, ptr, descr) \
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_LONG|access, \
- ptr, 0, sysctl_handle_long, "L", descr);
+ ptr, 0, sysctl_handle_long, "L", descr)
/* Oid for a long. The pointer must be non NULL. */
#define SYSCTL_ULONG(parent, nbr, name, access, ptr, val, descr) \
@@ -242,7 +242,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
#define SYSCTL_ADD_ULONG(ctx, parent, nbr, name, access, ptr, descr) \
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|access, \
- ptr, 0, sysctl_handle_long, "LU", descr);
+ ptr, 0, sysctl_handle_long, "LU", descr)
/* Oid for an opaque object. Specified by a pointer and a length. */
#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \
@@ -251,7 +251,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
#define SYSCTL_ADD_OPAQUE(ctx, parent, nbr, name, access, ptr, len, fmt, descr)\
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|access, \
- ptr, len, sysctl_handle_opaque, fmt, descr);
+ ptr, len, sysctl_handle_opaque, fmt, descr)
/* Oid for a struct. Specified by a pointer and a type. */
#define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) \
@@ -261,7 +261,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
#define SYSCTL_ADD_STRUCT(ctx, parent, nbr, name, access, ptr, type, descr) \
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|access, \
- ptr, sizeof(struct type), sysctl_handle_opaque, "S," #type, descr);
+ ptr, sizeof(struct type), sysctl_handle_opaque, "S," #type, descr)
/* Oid for a procedure. Specified by a pointer and an arg. */
#define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
@@ -270,7 +270,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
#define SYSCTL_ADD_PROC(ctx, parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
sysctl_add_oid(ctx, parent, nbr, name, access, \
- ptr, arg, handler, fmt, descr);
+ ptr, arg, handler, fmt, descr)
#endif /* _KERNEL */