Skip to content

Commit 8b6279d

Browse files
committed
common UPDATE improve different context error
1 parent 4aaf83d commit 8b6279d

File tree

5 files changed

+37
-37
lines changed

5 files changed

+37
-37
lines changed

src/ly_common.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,12 @@ void ly_log_dbg(uint32_t group, const char *format, ...);
232232
#define LY_CHECK_ARG_RET(CTX, ...) GETMACRO7(__VA_ARGS__, LY_CHECK_ARG_RET6, LY_CHECK_ARG_RET5, LY_CHECK_ARG_RET4, \
233233
LY_CHECK_ARG_RET3, LY_CHECK_ARG_RET2, LY_CHECK_ARG_RET1, DUMMY) (CTX, __VA_ARGS__)
234234

235-
#define LY_CHECK_CTX_EQUAL_RET2(CTX1, CTX2, RETVAL) if ((CTX1) && (CTX2) && ((CTX1) != (CTX2))) \
236-
{LOGERR(CTX1, LY_EINVAL, "Different contexts mixed in a single function call."); return RETVAL;}
237-
#define LY_CHECK_CTX_EQUAL_RET3(CTX1, CTX2, CTX3, RETVAL) LY_CHECK_CTX_EQUAL_RET2(CTX1, CTX2, RETVAL); \
238-
LY_CHECK_CTX_EQUAL_RET2(CTX2, CTX3, RETVAL); LY_CHECK_CTX_EQUAL_RET2(CTX1, CTX3, RETVAL)
239-
#define LY_CHECK_CTX_EQUAL_RET(CTX, ...) GETMACRO3(__VA_ARGS__, LY_CHECK_CTX_EQUAL_RET3, LY_CHECK_CTX_EQUAL_RET2, \
240-
DUMMY) (CTX, __VA_ARGS__)
235+
#define LY_CHECK_CTX_EQUAL_RET2(FUNC, CTX1, CTX2, RETVAL) if ((CTX1) && (CTX2) && ((CTX1) != (CTX2))) \
236+
{LOGERR(CTX1, LY_EINVAL, "Different contexts mixed in a \"%s\" function call.", FUNC); return RETVAL;}
237+
#define LY_CHECK_CTX_EQUAL_RET3(FUNC, CTX1, CTX2, CTX3, RETVAL) LY_CHECK_CTX_EQUAL_RET2(FUNC, CTX1, CTX2, RETVAL); \
238+
LY_CHECK_CTX_EQUAL_RET2(FUNC, CTX2, CTX3, RETVAL); LY_CHECK_CTX_EQUAL_RET2(FUNC, CTX1, CTX3, RETVAL)
239+
#define LY_CHECK_CTX_EQUAL_RET(FUNC, CTX, ...) GETMACRO3(__VA_ARGS__, LY_CHECK_CTX_EQUAL_RET3, LY_CHECK_CTX_EQUAL_RET2, \
240+
DUMMY) (FUNC, CTX, __VA_ARGS__)
241241

242242
/* count sequence size for LY_VCODE_INCHILDSTMT validation error code */
243243
int LY_VCODE_INSTREXP_len(const char *str);

src/tree_data.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ LIBYANG_API_DEF LY_ERR
10391039
lyd_insert_child(struct lyd_node *parent, struct lyd_node *node)
10401040
{
10411041
LY_CHECK_ARG_RET(NULL, parent, node, !parent->schema || (parent->schema->nodetype & LYD_NODE_INNER), LY_EINVAL);
1042-
LY_CHECK_CTX_EQUAL_RET(LYD_CTX(parent), LYD_CTX(node), LY_EINVAL);
1042+
LY_CHECK_CTX_EQUAL_RET(__func__, LYD_CTX(parent), LYD_CTX(node), LY_EINVAL);
10431043

10441044
LY_CHECK_RET(lyd_insert_check_schema(parent->schema, NULL, node->schema));
10451045

@@ -1105,7 +1105,7 @@ LIBYANG_API_DEF LY_ERR
11051105
lyd_insert_before(struct lyd_node *sibling, struct lyd_node *node)
11061106
{
11071107
LY_CHECK_ARG_RET(NULL, sibling, node, sibling != node, LY_EINVAL);
1108-
LY_CHECK_CTX_EQUAL_RET(LYD_CTX(sibling), LYD_CTX(node), LY_EINVAL);
1108+
LY_CHECK_CTX_EQUAL_RET(__func__, LYD_CTX(sibling), LYD_CTX(node), LY_EINVAL);
11091109

11101110
LY_CHECK_RET(lyd_insert_check_schema(NULL, sibling->schema, node->schema));
11111111

@@ -1129,7 +1129,7 @@ LIBYANG_API_DEF LY_ERR
11291129
lyd_insert_after(struct lyd_node *sibling, struct lyd_node *node)
11301130
{
11311131
LY_CHECK_ARG_RET(NULL, sibling, node, sibling != node, LY_EINVAL);
1132-
LY_CHECK_CTX_EQUAL_RET(LYD_CTX(sibling), LYD_CTX(node), LY_EINVAL);
1132+
LY_CHECK_CTX_EQUAL_RET(__func__, LYD_CTX(sibling), LYD_CTX(node), LY_EINVAL);
11331133

11341134
LY_CHECK_RET(lyd_insert_check_schema(NULL, sibling->schema, node->schema));
11351135

@@ -2752,8 +2752,8 @@ lyd_merge(struct lyd_node **target, const struct lyd_node *source, const struct
27522752
struct lyds_pool lyds = {0};
27532753

27542754
LY_CHECK_ARG_RET(NULL, target, LY_EINVAL);
2755-
LY_CHECK_CTX_EQUAL_RET(*target ? LYD_CTX(*target) : NULL, source ? LYD_CTX(source) : NULL, mod ? mod->ctx : NULL,
2756-
LY_EINVAL);
2755+
LY_CHECK_CTX_EQUAL_RET(__func__, *target ? LYD_CTX(*target) : NULL, source ? LYD_CTX(source) : NULL,
2756+
mod ? mod->ctx : NULL, LY_EINVAL);
27572757

27582758
if (!source) {
27592759
/* nothing to merge */
@@ -3110,7 +3110,7 @@ lyd_find_meta(const struct lyd_meta *first, const struct lys_module *module, con
31103110
size_t pref_len, name_len;
31113111

31123112
LY_CHECK_ARG_RET(NULL, module || strchr(name, ':'), name, NULL);
3113-
LY_CHECK_CTX_EQUAL_RET(first ? first->annotation->module->ctx : NULL, module ? module->ctx : NULL, NULL);
3113+
LY_CHECK_CTX_EQUAL_RET(__func__, first ? first->annotation->module->ctx : NULL, module ? module->ctx : NULL, NULL);
31143114

31153115
if (!first) {
31163116
return NULL;
@@ -3305,7 +3305,7 @@ lyd_find_sibling_dup_inst_set(const struct lyd_node *siblings, const struct lyd_
33053305
uint32_t comp_opts;
33063306

33073307
LY_CHECK_ARG_RET(NULL, target, set, LY_EINVAL);
3308-
LY_CHECK_CTX_EQUAL_RET(siblings ? LYD_CTX(siblings) : NULL, LYD_CTX(target), LY_EINVAL);
3308+
LY_CHECK_CTX_EQUAL_RET(__func__, siblings ? LYD_CTX(siblings) : NULL, LYD_CTX(target), LY_EINVAL);
33093309

33103310
LY_CHECK_RET(ly_set_new(set));
33113311

src/tree_data_new.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ lyd_new_inner(struct lyd_node *parent, const struct lys_module *module, const ch
505505
const struct ly_ctx *ctx = parent ? LYD_CTX(parent) : (module ? module->ctx : NULL);
506506

507507
LY_CHECK_ARG_RET(ctx, parent || module, parent || node, name, LY_EINVAL);
508-
LY_CHECK_CTX_EQUAL_RET(parent ? LYD_CTX(parent) : NULL, module ? module->ctx : NULL, LY_EINVAL);
508+
LY_CHECK_CTX_EQUAL_RET(__func__, parent ? LYD_CTX(parent) : NULL, module ? module->ctx : NULL, LY_EINVAL);
509509

510510
if (!module) {
511511
module = parent->schema->module;
@@ -621,7 +621,7 @@ lyd_new_list(struct lyd_node *parent, const struct lys_module *module, const cha
621621
va_list ap;
622622

623623
LY_CHECK_ARG_RET(ctx, parent || module, parent || node, name, LY_EINVAL);
624-
LY_CHECK_CTX_EQUAL_RET(parent ? LYD_CTX(parent) : NULL, module ? module->ctx : NULL, LY_EINVAL);
624+
LY_CHECK_CTX_EQUAL_RET(__func__, parent ? LYD_CTX(parent) : NULL, module ? module->ctx : NULL, LY_EINVAL);
625625
LY_CHECK_RET(lyd_new_val_get_format(options, &format));
626626
LY_CHECK_ARG_RET(ctx, !(store_only && (format == LY_VALUE_CANON || format == LY_VALUE_LYB)), LY_EINVAL);
627627

@@ -726,7 +726,7 @@ lyd_new_list2(struct lyd_node *parent, const struct lys_module *module, const ch
726726
uint32_t getnext_opts = (options & LYD_NEW_VAL_OUTPUT) ? LYS_GETNEXT_OUTPUT : 0;
727727

728728
LY_CHECK_ARG_RET(ctx, parent || module, parent || node, name, LY_EINVAL);
729-
LY_CHECK_CTX_EQUAL_RET(parent ? LYD_CTX(parent) : NULL, module ? module->ctx : NULL, LY_EINVAL);
729+
LY_CHECK_CTX_EQUAL_RET(__func__, parent ? LYD_CTX(parent) : NULL, module ? module->ctx : NULL, LY_EINVAL);
730730

731731
if (!module) {
732732
module = parent->schema->module;
@@ -781,7 +781,7 @@ lyd_new_list3(struct lyd_node *parent, const struct lys_module *module, const ch
781781

782782
LY_CHECK_RET(lyd_new_val_get_format(options, &format));
783783
LY_CHECK_ARG_RET(ctx, parent || module, parent || node, name, (format != LY_VALUE_LYB) || value_lengths, LY_EINVAL);
784-
LY_CHECK_CTX_EQUAL_RET(parent ? LYD_CTX(parent) : NULL, module ? module->ctx : NULL, LY_EINVAL);
784+
LY_CHECK_CTX_EQUAL_RET(__func__, parent ? LYD_CTX(parent) : NULL, module ? module->ctx : NULL, LY_EINVAL);
785785
LY_CHECK_ARG_RET(ctx, !(store_only && (format == LY_VALUE_CANON || format == LY_VALUE_LYB)), LY_EINVAL);
786786

787787
/* create the list node */
@@ -845,7 +845,7 @@ _lyd_new_term(struct lyd_node *parent, const struct lys_module *module, const ch
845845
LY_VALUE_FORMAT format;
846846

847847
LY_CHECK_ARG_RET(ctx, parent || module, parent || node, name, LY_EINVAL);
848-
LY_CHECK_CTX_EQUAL_RET(parent ? LYD_CTX(parent) : NULL, module ? module->ctx : NULL, LY_EINVAL);
848+
LY_CHECK_CTX_EQUAL_RET(__func__, parent ? LYD_CTX(parent) : NULL, module ? module->ctx : NULL, LY_EINVAL);
849849
LY_CHECK_RET(lyd_new_val_get_format(options, &format));
850850
LY_CHECK_ARG_RET(ctx, !(store_only && (format == LY_VALUE_CANON || format == LY_VALUE_LYB)), LY_EINVAL);
851851

@@ -941,7 +941,7 @@ lyd_new_any(struct lyd_node *parent, const struct lys_module *module, const char
941941

942942
LY_CHECK_ARG_RET(ctx, parent || module, parent || node, name,
943943
(value_type == LYD_ANYDATA_DATATREE) || (value_type == LYD_ANYDATA_STRING) || value, LY_EINVAL);
944-
LY_CHECK_CTX_EQUAL_RET(parent ? LYD_CTX(parent) : NULL, module ? module->ctx : NULL, LY_EINVAL);
944+
LY_CHECK_CTX_EQUAL_RET(__func__, parent ? LYD_CTX(parent) : NULL, module ? module->ctx : NULL, LY_EINVAL);
945945

946946
if (!module) {
947947
module = parent->schema->module;
@@ -1007,7 +1007,7 @@ lyd_new_meta(const struct ly_ctx *ctx, struct lyd_node *parent, const struct lys
10071007
ly_bool store_only = options & LYD_NEW_VAL_STORE_ONLY;
10081008

10091009
LY_CHECK_ARG_RET(ctx, ctx || parent, name, module || strchr(name, ':'), parent || meta, LY_EINVAL);
1010-
LY_CHECK_CTX_EQUAL_RET(ctx, parent ? LYD_CTX(parent) : NULL, module ? module->ctx : NULL, LY_EINVAL);
1010+
LY_CHECK_CTX_EQUAL_RET(__func__, ctx, parent ? LYD_CTX(parent) : NULL, module ? module->ctx : NULL, LY_EINVAL);
10111011
if (!ctx) {
10121012
ctx = module ? module->ctx : LYD_CTX(parent);
10131013
}
@@ -1050,7 +1050,7 @@ lyd_new_meta2(const struct ly_ctx *ctx, struct lyd_node *parent, uint32_t option
10501050
ly_bool store_only = options & LYD_NEW_VAL_STORE_ONLY;
10511051

10521052
LY_CHECK_ARG_RET(NULL, ctx, attr, parent || meta, LY_EINVAL);
1053-
LY_CHECK_CTX_EQUAL_RET(ctx, parent ? LYD_CTX(parent) : NULL, LY_EINVAL);
1053+
LY_CHECK_CTX_EQUAL_RET(__func__, ctx, parent ? LYD_CTX(parent) : NULL, LY_EINVAL);
10541054

10551055
if (parent && !parent->schema) {
10561056
LOGERR(ctx, LY_EINVAL, "Cannot add metadata to an opaque node \"%s\".",
@@ -1092,7 +1092,7 @@ lyd_new_opaq(struct lyd_node *parent, const struct ly_ctx *ctx, const char *name
10921092
uint32_t hints = 0;
10931093

10941094
LY_CHECK_ARG_RET(ctx, parent || ctx, parent || node, name, module_name, !prefix || !strcmp(prefix, module_name), LY_EINVAL);
1095-
LY_CHECK_CTX_EQUAL_RET(ctx, parent ? LYD_CTX(parent) : NULL, LY_EINVAL);
1095+
LY_CHECK_CTX_EQUAL_RET(__func__, ctx, parent ? LYD_CTX(parent) : NULL, LY_EINVAL);
10961096

10971097
if (!ctx) {
10981098
ctx = LYD_CTX(parent);
@@ -1122,7 +1122,7 @@ lyd_new_opaq2(struct lyd_node *parent, const struct ly_ctx *ctx, const char *nam
11221122
struct lyd_node *ret = NULL;
11231123

11241124
LY_CHECK_ARG_RET(ctx, parent || ctx, parent || node, name, module_ns, LY_EINVAL);
1125-
LY_CHECK_CTX_EQUAL_RET(ctx, parent ? LYD_CTX(parent) : NULL, LY_EINVAL);
1125+
LY_CHECK_CTX_EQUAL_RET(__func__, ctx, parent ? LYD_CTX(parent) : NULL, LY_EINVAL);
11261126

11271127
if (!ctx) {
11281128
ctx = LYD_CTX(parent);
@@ -1908,7 +1908,7 @@ lyd_new_path(struct lyd_node *parent, const struct ly_ctx *ctx, const char *path
19081908
{
19091909
LY_CHECK_ARG_RET(ctx, parent || ctx, path, (path[0] == '/') || parent,
19101910
!(options & LYD_NEW_VAL_BIN) || !(options & LYD_NEW_VAL_CANON), LY_EINVAL);
1911-
LY_CHECK_CTX_EQUAL_RET(parent ? LYD_CTX(parent) : NULL, ctx, LY_EINVAL);
1911+
LY_CHECK_CTX_EQUAL_RET(__func__, parent ? LYD_CTX(parent) : NULL, ctx, LY_EINVAL);
19121912

19131913
return lyd_new_path_(parent, ctx, NULL, path, value, 0, LYD_ANYDATA_STRING, options, node, NULL);
19141914
}
@@ -1920,7 +1920,7 @@ lyd_new_path2(struct lyd_node *parent, const struct ly_ctx *ctx, const char *pat
19201920
{
19211921
LY_CHECK_ARG_RET(ctx, parent || ctx, path, (path[0] == '/') || parent,
19221922
!(options & LYD_NEW_VAL_BIN) || !(options & LYD_NEW_VAL_CANON), LY_EINVAL);
1923-
LY_CHECK_CTX_EQUAL_RET(parent ? LYD_CTX(parent) : NULL, ctx, LY_EINVAL);
1923+
LY_CHECK_CTX_EQUAL_RET(__func__, parent ? LYD_CTX(parent) : NULL, ctx, LY_EINVAL);
19241924

19251925
return lyd_new_path_(parent, ctx, NULL, path, value, value_len, value_type, options, new_parent, new_node);
19261926
}
@@ -1933,7 +1933,7 @@ lyd_new_ext_path(struct lyd_node *parent, const struct lysc_ext_instance *ext, c
19331933

19341934
LY_CHECK_ARG_RET(ctx, ext, path, (path[0] == '/') || parent,
19351935
!(options & LYD_NEW_VAL_BIN) || !(options & LYD_NEW_VAL_CANON), LY_EINVAL);
1936-
LY_CHECK_CTX_EQUAL_RET(parent ? LYD_CTX(parent) : NULL, ctx, LY_EINVAL);
1936+
LY_CHECK_CTX_EQUAL_RET(__func__, parent ? LYD_CTX(parent) : NULL, ctx, LY_EINVAL);
19371937

19381938
return lyd_new_path_(parent, ctx, ext, path, value, 0, LYD_ANYDATA_STRING, options, node, NULL);
19391939
}
@@ -2155,7 +2155,7 @@ lyd_new_implicit_all(struct lyd_node **tree, const struct ly_ctx *ctx, uint32_t
21552155
LY_ERR rc = LY_SUCCESS;
21562156

21572157
LY_CHECK_ARG_RET(ctx, tree, *tree || ctx, LY_EINVAL);
2158-
LY_CHECK_CTX_EQUAL_RET(*tree ? LYD_CTX(*tree) : NULL, ctx, LY_EINVAL);
2158+
LY_CHECK_CTX_EQUAL_RET(__func__, *tree ? LYD_CTX(*tree) : NULL, ctx, LY_EINVAL);
21592159
if (diff) {
21602160
*diff = NULL;
21612161
}
@@ -2196,7 +2196,7 @@ lyd_new_implicit_module(struct lyd_node **tree, const struct lys_module *module,
21962196
struct ly_ht *getnext_ht = NULL;
21972197

21982198
LY_CHECK_ARG_RET(NULL, tree, module, LY_EINVAL);
2199-
LY_CHECK_CTX_EQUAL_RET(*tree ? LYD_CTX(*tree) : NULL, module ? module->ctx : NULL, LY_EINVAL);
2199+
LY_CHECK_CTX_EQUAL_RET(__func__, *tree ? LYD_CTX(*tree) : NULL, module ? module->ctx : NULL, LY_EINVAL);
22002200
if (diff) {
22012201
*diff = NULL;
22022202
}

src/tree_schema.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ lys_find_child(const struct lysc_node *parent, const struct lys_module *module,
411411
const struct lysc_node *node = NULL;
412412

413413
LY_CHECK_ARG_RET(NULL, module, name, NULL);
414-
LY_CHECK_CTX_EQUAL_RET(parent ? parent->module->ctx : NULL, module->ctx, NULL);
414+
LY_CHECK_CTX_EQUAL_RET(__func__, parent ? parent->module->ctx : NULL, module->ctx, NULL);
415415
if (!nodetype) {
416416
nodetype = LYS_NODETYPE_MASK;
417417
}
@@ -448,7 +448,7 @@ lys_find_xpath_atoms(const struct ly_ctx *ctx, const struct lysc_node *ctx_node,
448448
uint32_t i;
449449

450450
LY_CHECK_ARG_RET(NULL, ctx || ctx_node, xpath, set, LY_EINVAL);
451-
LY_CHECK_CTX_EQUAL_RET(ctx, ctx_node ? ctx_node->module->ctx : NULL, LY_EINVAL);
451+
LY_CHECK_CTX_EQUAL_RET(__func__, ctx, ctx_node ? ctx_node->module->ctx : NULL, LY_EINVAL);
452452
if (!(options & LYXP_SCNODE_ALL)) {
453453
options |= LYXP_SCNODE;
454454
}
@@ -495,7 +495,7 @@ lys_find_expr_atoms(const struct lysc_node *ctx_node, const struct lys_module *c
495495
uint32_t i;
496496

497497
LY_CHECK_ARG_RET(NULL, cur_mod, expr, prefixes, set, LY_EINVAL);
498-
LY_CHECK_CTX_EQUAL_RET(ctx_node ? ctx_node->module->ctx : NULL, cur_mod->ctx, LY_EINVAL);
498+
LY_CHECK_CTX_EQUAL_RET(__func__, ctx_node ? ctx_node->module->ctx : NULL, cur_mod->ctx, LY_EINVAL);
499499
if (!(options & LYXP_SCNODE_ALL)) {
500500
options = LYXP_SCNODE;
501501
}
@@ -543,7 +543,7 @@ lys_find_xpath(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const
543543
uint32_t i;
544544

545545
LY_CHECK_ARG_RET(NULL, ctx || ctx_node, xpath, set, LY_EINVAL);
546-
LY_CHECK_CTX_EQUAL_RET(ctx, ctx_node ? ctx_node->module->ctx : NULL, LY_EINVAL);
546+
LY_CHECK_CTX_EQUAL_RET(__func__, ctx, ctx_node ? ctx_node->module->ctx : NULL, LY_EINVAL);
547547
if (!(options & LYXP_SCNODE_ALL)) {
548548
options |= LYXP_SCNODE;
549549
}
@@ -625,7 +625,7 @@ lys_find_path_atoms(const struct ly_ctx *ctx, const struct lysc_node *ctx_node,
625625
struct ly_path *p = NULL;
626626

627627
LY_CHECK_ARG_RET(ctx, ctx || ctx_node, path, set, LY_EINVAL);
628-
LY_CHECK_CTX_EQUAL_RET(ctx, ctx_node ? ctx_node->module->ctx : NULL, LY_EINVAL);
628+
LY_CHECK_CTX_EQUAL_RET(__func__, ctx, ctx_node ? ctx_node->module->ctx : NULL, LY_EINVAL);
629629

630630
if (!ctx) {
631631
ctx = ctx_node->module->ctx;
@@ -660,7 +660,7 @@ lys_find_path(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const
660660
uint8_t oper;
661661

662662
LY_CHECK_ARG_RET(ctx, ctx || ctx_node, path, NULL);
663-
LY_CHECK_CTX_EQUAL_RET(ctx, ctx_node ? ctx_node->module->ctx : NULL, NULL);
663+
LY_CHECK_CTX_EQUAL_RET(__func__, ctx, ctx_node ? ctx_node->module->ctx : NULL, NULL);
664664

665665
if (!ctx) {
666666
ctx = ctx_node->module->ctx;

src/validation.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,7 +2160,7 @@ LIBYANG_API_DEF LY_ERR
21602160
lyd_validate_all(struct lyd_node **tree, const struct ly_ctx *ctx, uint32_t val_opts, struct lyd_node **diff)
21612161
{
21622162
LY_CHECK_ARG_RET(NULL, tree, *tree || ctx, LY_EINVAL);
2163-
LY_CHECK_CTX_EQUAL_RET(*tree ? LYD_CTX(*tree) : NULL, ctx, LY_EINVAL);
2163+
LY_CHECK_CTX_EQUAL_RET(__func__, *tree ? LYD_CTX(*tree) : NULL, ctx, LY_EINVAL);
21642164
if (!ctx) {
21652165
ctx = LYD_CTX(*tree);
21662166
}
@@ -2175,7 +2175,7 @@ LIBYANG_API_DEF LY_ERR
21752175
lyd_validate_module(struct lyd_node **tree, const struct lys_module *module, uint32_t val_opts, struct lyd_node **diff)
21762176
{
21772177
LY_CHECK_ARG_RET(NULL, tree, module, !(val_opts & LYD_VALIDATE_PRESENT), LY_EINVAL);
2178-
LY_CHECK_CTX_EQUAL_RET(*tree ? LYD_CTX(*tree) : NULL, module->ctx, LY_EINVAL);
2178+
LY_CHECK_CTX_EQUAL_RET(__func__, *tree ? LYD_CTX(*tree) : NULL, module->ctx, LY_EINVAL);
21792179
if (diff) {
21802180
*diff = NULL;
21812181
}
@@ -2193,7 +2193,7 @@ lyd_validate_module_final(struct lyd_node *tree, const struct lys_module *module
21932193
struct ly_ht *getnext_ht = NULL;
21942194

21952195
LY_CHECK_ARG_RET(NULL, module, !(val_opts & (LYD_VALIDATE_PRESENT | LYD_VALIDATE_NOT_FINAL)), LY_EINVAL);
2196-
LY_CHECK_CTX_EQUAL_RET(tree ? LYD_CTX(tree) : NULL, module->ctx, LY_EINVAL);
2196+
LY_CHECK_CTX_EQUAL_RET(__func__, tree ? LYD_CTX(tree) : NULL, module->ctx, LY_EINVAL);
21972197

21982198
/* module is unchanged but we need to get the first module data node */
21992199
mod = lyd_mod_next_module(tree, module, module->ctx, &i, &first);

0 commit comments

Comments
 (0)