Skip to content

Commit

Permalink
STM32: No need to use mutable whe not needed
Browse files Browse the repository at this point in the history
MUTABLE_LIST_FOR_EACH is useful only when changes are made to the list
while iterating over it, otherwise LIST_FOR_EACH is the right choice.

Signed-off-by: Davide Bettio <[email protected]>
  • Loading branch information
bettio committed Oct 27, 2023
1 parent fa70b29 commit 05e98e4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/platforms/stm32/src/lib/gpio_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,7 @@ void gpio_interrupt_callback(Context *ctx, uint32_t exti)

struct GPIOData *gpio_data = ctx->platform_data;
struct ListHead *item;
struct ListHead *tmp;
MUTABLE_LIST_FOR_EACH (item, tmp, &gpio_data->gpio_listeners) {
LIST_FOR_EACH (item, &gpio_data->gpio_listeners) {
struct GPIOListenerData *gpio_listener = GET_LIST_ENTRY(item, struct GPIOListenerData, gpio_listener_list_head);
if (gpio_listener->exti == exti) {
listening_pid = gpio_listener->target_local_pid;
Expand Down

0 comments on commit 05e98e4

Please sign in to comment.