Skip to content

Commit d24450b

Browse files
moonlight83340henrikbrixandersen
authored andcommitted
drivers: stepper: adi_tmc: tmc50xx: Remove redundant pointer check
The actual_velocity pointer is dereferenced unconditionally before the NULL check, making the conditional LOG_DBG() guard ineffective. Since actual_velocity must be valid to reach this point, the conditional check is redundant and misleading. Remove it and log the value unconditionally to reflect the actual control flow. Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
1 parent c0e8822 commit d24450b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/stepper/adi_tmc/tmc50xx/tmc50xx_stepper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ static int read_vactual(const struct device *dev, int32_t *actual_velocity)
7474
}
7575

7676
*actual_velocity = sign_extend(*actual_velocity, TMC_RAMP_VACTUAL_SHIFT);
77-
if (actual_velocity) {
78-
LOG_DBG("actual velocity: %d", *actual_velocity);
79-
}
77+
78+
LOG_DBG("actual velocity: %d", *actual_velocity);
79+
8080
return 0;
8181
}
8282

0 commit comments

Comments
 (0)