Browse Source

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>
pull/92460/head
Pisit Sawangvonganan 3 weeks ago committed by Daniel DeGrasse
parent
commit
a3d37e3f49
  1. 12
      lib/smf/smf.c

12
lib/smf/smf.c

@ -400,14 +400,6 @@ int32_t smf_run_state(struct smf_ctx *const ctx) @@ -400,14 +400,6 @@ int32_t smf_run_state(struct smf_ctx *const ctx)
#ifdef CONFIG_SMF_ANCESTOR_SUPPORT
ctx->executing = ctx->current;
#endif
#ifndef CONFIG_SMF_ANCESTOR_SUPPORT
if (ctx->current->run) {
ctx->current->run(ctx);
}
#else
ctx->executing = ctx->current;
if (ctx->current->run) {
enum smf_state_result rc = ctx->current->run(ctx);
@ -419,6 +411,10 @@ int32_t smf_run_state(struct smf_ctx *const ctx) @@ -419,6 +411,10 @@ int32_t smf_run_state(struct smf_ctx *const ctx)
if (smf_execute_ancestor_run_actions(ctx)) {
return ctx->terminate_val;
}
#else
if (ctx->current->run) {
ctx->current->run(ctx);
}
#endif
return 0;
}

Loading…
Cancel
Save