Skip to content

Commit a3d37e3

Browse files
ndrs-pstdanieldegrasse
authored andcommitted
lib: smf: correct redundant ctx->executing assignment
Removed duplicate assignment of ctx->executing under CONFIG_SMF_ANCESTOR_SUPPORT. Also replaced #ifndef with #ifdef to align with the positive logic used elsewhere in this file. Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
1 parent 8105362 commit a3d37e3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/smf/smf.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -400,14 +400,6 @@ int32_t smf_run_state(struct smf_ctx *const ctx)
400400

401401
#ifdef CONFIG_SMF_ANCESTOR_SUPPORT
402402
ctx->executing = ctx->current;
403-
#endif
404-
405-
#ifndef CONFIG_SMF_ANCESTOR_SUPPORT
406-
if (ctx->current->run) {
407-
ctx->current->run(ctx);
408-
}
409-
#else
410-
ctx->executing = ctx->current;
411403
if (ctx->current->run) {
412404
enum smf_state_result rc = ctx->current->run(ctx);
413405

@@ -419,6 +411,10 @@ int32_t smf_run_state(struct smf_ctx *const ctx)
419411
if (smf_execute_ancestor_run_actions(ctx)) {
420412
return ctx->terminate_val;
421413
}
414+
#else
415+
if (ctx->current->run) {
416+
ctx->current->run(ctx);
417+
}
422418
#endif
423419
return 0;
424420
}

0 commit comments

Comments
 (0)