Re: [PATCH v2] rtla/actions: Fix condition for buffer reallocation
From: Tomas Glozar
Date: Tue Sep 16 2025 - 09:15:51 EST
po 15. 9. 2025 v 20:11 odesílatel Wander Lairson Costa
<wander@xxxxxxxxxx> napsal:
>
> The condition to check if the actions buffer needs to be resized was
> incorrect. The check `self->size >= self->len` would evaluate to
> true on almost every call to `actions_new()`, causing the buffer to
> be reallocated unnecessarily each time an action was added.
>
> Fix the condition to `self->len >= self.size`, ensuring
> that the buffer is only resized when it is actually full.
>
> Fixes: 6ea082b171e00 ("rtla/timerlat: Add action on threshold feature")
> Signed-off-by: Wander Lairson Costa <wander@xxxxxxxxxx>
>
The blame goes entirely on me for getting confused by my own naming of
the fields. Thank you.
Reviewed-by: Tomas Glozar <tglozar@xxxxxxxxxx>
Tomas