Commit c82e1b16 authored by Daniel Salzman's avatar Daniel Salzman

conf: remove redundant parameter from conf_exec_callbacks

parent 93e5c937
......@@ -557,7 +557,7 @@ static int parser_calls(
.line = prev_line
};
int ret = conf_exec_callbacks(prev_item, &args);
int ret = conf_exec_callbacks(&args);
if (ret != KNOT_EOK) {
log_prev_err(&args, ret);
return ret;
......@@ -606,8 +606,7 @@ static int parser_calls(
.line = parser->line_count
};
int ret = conf_exec_callbacks(is_id ? node->item->var.g.id : node->item,
&args);
int ret = conf_exec_callbacks(&args);
if (ret != KNOT_EOK) {
log_call_err(parser, &args, ret);
}
......
......@@ -732,7 +732,7 @@ static int set_item(
};
// Call the item callbacks.
io->error.code = conf_exec_callbacks(args.item, &args);
io->error.code = conf_exec_callbacks(&args);
if (io->error.code != KNOT_EOK) {
io->error.str = args.err_str;
ret = FCN(io);
......@@ -1106,7 +1106,7 @@ static int check_section(
// Check the identifier.
if ((group->flags & YP_FMULTI) != 0 && group->var.g.id == item) {
io->error.code = conf_exec_callbacks(item, &args);
io->error.code = conf_exec_callbacks(&args);
if (io->error.code != KNOT_EOK) {
io_reset_val(io, group, item, NULL, 0, false, NULL);
goto check_section_error;
......@@ -1133,7 +1133,7 @@ static int check_section(
args.data = bin.data;
args.data_len = bin.len;
io->error.code = conf_exec_callbacks(item, &args);
io->error.code = conf_exec_callbacks(&args);
if (io->error.code != KNOT_EOK) {
io_reset_val(io, group, item, id, id_len, false,
&bin);
......@@ -1153,7 +1153,7 @@ static int check_section(
args.data = NULL;
args.data_len = 0;
io->error.code = conf_exec_callbacks(group, &args);
io->error.code = conf_exec_callbacks(&args);
if (io->error.code != KNOT_EOK) {
io_reset_val(io, group, NULL, id, id_len, false, NULL);
goto check_section_error;
......
......@@ -49,15 +49,14 @@ static bool is_default_id(
}
int conf_exec_callbacks(
const yp_item_t *item,
conf_check_t *args)
{
if (item == NULL || args == NULL) {
if (args == NULL) {
return KNOT_EINVAL;
}
for (size_t i = 0; i < YP_MAX_MISC_COUNT; i++) {
int (*fcn)(conf_check_t *) = item->misc[i];
int (*fcn)(conf_check_t *) = args->item->misc[i];
if (fcn == NULL) {
break;
}
......
......@@ -45,7 +45,6 @@ typedef struct {
} conf_check_t;
int conf_exec_callbacks(
const yp_item_t *item,
conf_check_t *args
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment