From 39cffa4e9b027162430ea7f3c288256b232a1ed7 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 22 Oct 2015 10:33:01 +0200 Subject: [PATCH] cleanup: declare vars before code --- libdm/libdm-config.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c index b2082c865..c8984b203 100644 --- a/libdm/libdm-config.c +++ b/libdm/libdm-config.c @@ -157,21 +157,18 @@ struct dm_config_tree *dm_config_insert_cascaded_tree(struct dm_config_tree *fir static struct dm_config_node *_config_reverse(struct dm_config_node *head) { - if (!head) - return NULL; - struct dm_config_node *left = head, *middle = NULL, *right = NULL; - do { + while (left) { right = middle; middle = left; left = left->sib; middle->sib = right; middle->child = _config_reverse(middle->child); - } while (left); + } return middle; -}; +} int dm_config_parse(struct dm_config_tree *cft, const char *start, const char *end) {