diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-03-15 16:14:53 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-03-19 08:10:29 +0900 |
commit | 03677889f0ef42cdc534bf3b31265a054b20a354 (patch) | |
tree | 53caa0977a8afc5d0ee90e038ffd566e9e22451f /src/rfkill | |
parent | 40f35786b0030f1f7c4b88828776ada1dd74d03e (diff) | |
download | systemd-03677889f0ef42cdc534bf3b31265a054b20a354.tar.gz |
list: declare iterator of LIST_FOREACH() in the loop
Diffstat (limited to 'src/rfkill')
-rw-r--r-- | src/rfkill/rfkill.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/rfkill/rfkill.c b/src/rfkill/rfkill.c index bca2f3b812..7e8b8a27ef 100644 --- a/src/rfkill/rfkill.c +++ b/src/rfkill/rfkill.c @@ -188,17 +188,14 @@ static int load_state(Context *c, const struct rfkill_event *event) { } static void save_state_queue_remove(Context *c, int idx, const char *state_file) { - struct write_queue_item *item, *tmp; - assert(c); - LIST_FOREACH_SAFE(queue, item, tmp, c->write_queue) { + LIST_FOREACH_SAFE(queue, item, tmp, c->write_queue) if ((state_file && streq(item->file, state_file)) || idx == item->rfkill_idx) { log_debug("Canceled previous save state of '%s' to %s.", one_zero(item->state), item->file); LIST_REMOVE(queue, c->write_queue, item); write_queue_item_free(item); } - } } static int save_state_queue(Context *c, const struct rfkill_event *event) { |