diff --git a/src/ctl/ctl.c b/src/ctl/ctl.c index 124d56f6cc..d54e8390ea 100644 --- a/src/ctl/ctl.c +++ b/src/ctl/ctl.c @@ -44,7 +44,7 @@ #define CTL_VALUE_ARG_SEPARATOR "," static int ctl_global_first_free = 0; -static struct ctl_node CTL_NODE(global, )[CTL_MAX_ENTRIES]; +static struct ctl_node CTL_NODE(global)[CTL_MAX_ENTRIES]; /* * This is the top level node of the ctl tree structure. Each node can contain @@ -316,7 +316,7 @@ int ctl_query(struct ctl *ctl, void *ctx, enum ctl_query_source source, int ret = -1; - const struct ctl_node *n = ctl_find_node(CTL_NODE(global, ), name, indexes); + const struct ctl_node *n = ctl_find_node(CTL_NODE(global), name, indexes); if (n == NULL && ctl) { ctl_delete_indexes(indexes); @@ -343,7 +343,7 @@ int ctl_query(struct ctl *ctl, void *ctx, enum ctl_query_source source, void ctl_register_module_node(struct ctl *c, const char *name, struct ctl_node *n) { struct ctl_node *nnode = c == NULL - ? &CTL_NODE(global, )[ctl_global_first_free++] + ? &CTL_NODE(global)[ctl_global_first_free++] : &c->root[c->first_free++]; nnode->children = n; diff --git a/src/ctl/ctl.h b/src/ctl/ctl.h index f183abaf3b..9327b01afe 100644 --- a/src/ctl/ctl.h +++ b/src/ctl/ctl.h @@ -201,13 +201,13 @@ int ctl_query(struct ctl *ctl, void *ctx, enum ctl_query_source source, #define CTL_LEAF_RW(name) \ { \ CTL_STR(name), CTL_NODE_LEAF, \ - {CTL_READ_HANDLER(name, ), CTL_WRITE_HANDLER(name, ), NULL}, \ + {CTL_READ_HANDLER(name), CTL_WRITE_HANDLER(name), NULL}, \ &CTL_ARG(name), NULL \ } #define CTL_REGISTER_MODULE(_ctl, name) \ ctl_register_module_node((_ctl), CTL_STR(name), \ - (struct ctl_node *)CTL_NODE(name, )) + (struct ctl_node *)CTL_NODE(name)) #ifdef __cplusplus } diff --git a/test/ctl/ctl_debug.c b/test/ctl/ctl_debug.c index d523b3f801..711cb5e179 100644 --- a/test/ctl/ctl_debug.c +++ b/test/ctl/ctl_debug.c @@ -24,10 +24,10 @@ struct ctl *get_debug_ctl(void) { return ctl_debug; } /* * CTL_WRITE_HANDLER(alloc_pattern) -- sets the alloc_pattern field in heap */ -static int -CTL_WRITE_HANDLER(alloc_pattern, )(void *ctx, enum ctl_query_source source, - void *arg, - struct ctl_index_utlist *indexes) { +static int CTL_WRITE_HANDLER(alloc_pattern)(void *ctx, + enum ctl_query_source source, + void *arg, + struct ctl_index_utlist *indexes) { /* suppress unused-parameter errors */ (void)source, (void)indexes, (void)ctx; @@ -39,10 +39,10 @@ CTL_WRITE_HANDLER(alloc_pattern, )(void *ctx, enum ctl_query_source source, /* * CTL_READ_HANDLER(alloc_pattern) -- returns alloc_pattern heap field */ -static int CTL_READ_HANDLER(alloc_pattern, )(void *ctx, - enum ctl_query_source source, - void *arg, - struct ctl_index_utlist *indexes) { +static int CTL_READ_HANDLER(alloc_pattern)(void *ctx, + enum ctl_query_source source, + void *arg, + struct ctl_index_utlist *indexes) { /* suppress unused-parameter errors */ (void)source, (void)indexes, (void)ctx; @@ -51,10 +51,10 @@ static int CTL_READ_HANDLER(alloc_pattern, )(void *ctx, return 0; } -static int -CTL_WRITE_HANDLER(enable_logging, )(void *ctx, enum ctl_query_source source, - void *arg, - struct ctl_index_utlist *indexes) { +static int CTL_WRITE_HANDLER(enable_logging)(void *ctx, + enum ctl_query_source source, + void *arg, + struct ctl_index_utlist *indexes) { /* suppress unused-parameter errors */ (void)source, (void)indexes, (void)ctx; @@ -63,10 +63,10 @@ CTL_WRITE_HANDLER(enable_logging, )(void *ctx, enum ctl_query_source source, return 0; } -static int -CTL_READ_HANDLER(enable_logging, )(void *ctx, enum ctl_query_source source, - void *arg, - struct ctl_index_utlist *indexes) { +static int CTL_READ_HANDLER(enable_logging)(void *ctx, + enum ctl_query_source source, + void *arg, + struct ctl_index_utlist *indexes) { /* suppress unused-parameter errors */ (void)source, (void)indexes, (void)ctx; @@ -75,10 +75,9 @@ CTL_READ_HANDLER(enable_logging, )(void *ctx, enum ctl_query_source source, return 0; } -static int CTL_WRITE_HANDLER(log_level, )(void *ctx, - enum ctl_query_source source, - void *arg, - struct ctl_index_utlist *indexes) { +static int CTL_WRITE_HANDLER(log_level)(void *ctx, enum ctl_query_source source, + void *arg, + struct ctl_index_utlist *indexes) { /* suppress unused-parameter errors */ (void)source, (void)indexes, (void)ctx; @@ -87,10 +86,9 @@ static int CTL_WRITE_HANDLER(log_level, )(void *ctx, return 0; } -static int CTL_READ_HANDLER(log_level, )(void *ctx, - enum ctl_query_source source, - void *arg, - struct ctl_index_utlist *indexes) { +static int CTL_READ_HANDLER(log_level)(void *ctx, enum ctl_query_source source, + void *arg, + struct ctl_index_utlist *indexes) { /* suppress unused-parameter errors */ (void)source, (void)indexes, (void)ctx; @@ -105,15 +103,15 @@ static const struct ctl_argument CTL_ARG(enable_logging) = CTL_ARG_BOOLEAN; static const struct ctl_argument CTL_ARG(log_level) = CTL_ARG_INT; -static const struct ctl_node CTL_NODE(heap, )[] = {CTL_LEAF_RW(alloc_pattern), - CTL_LEAF_RW(enable_logging), - CTL_LEAF_RW(log_level), +static const struct ctl_node CTL_NODE(heap)[] = {CTL_LEAF_RW(alloc_pattern), + CTL_LEAF_RW(enable_logging), + CTL_LEAF_RW(log_level), - CTL_NODE_END}; + CTL_NODE_END}; -static const struct ctl_node CTL_NODE(debug, )[] = {CTL_CHILD(heap, ), +static const struct ctl_node CTL_NODE(debug)[] = {CTL_CHILD(heap), - CTL_NODE_END}; + CTL_NODE_END}; /* * debug_ctl_register -- registers ctl nodes for "debug" module