From 420f26552469aa8b98692c27de2320a9c1c5dbc2 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Sun, 29 Sep 2019 23:59:05 +0300 Subject: power: clang-format * Using AOSP interface .clang-format * Clean Android.mk while we are at it Change-Id: I630f72e3dffb676ca1930e72945e897f62103ada --- list.c | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) (limited to 'list.c') diff --git a/list.c b/list.c index 7b9e4d3..d1cceaf 100644 --- a/list.c +++ b/list.c @@ -31,23 +31,20 @@ #include #include -#include "list.h" #include +#include "list.h" -int init_list_head(struct list_node *head) -{ - if (head == NULL) - return -1; +int init_list_head(struct list_node* head) { + if (head == NULL) return -1; memset(head, 0, sizeof(*head)); return 0; } -struct list_node *add_list_node(struct list_node *head, void *data) -{ +struct list_node* add_list_node(struct list_node* head, void* data) { /* Create a new list_node. And put 'data' into it. */ - struct list_node *new_node; + struct list_node* new_node; if (head == NULL) { return NULL; @@ -66,18 +63,16 @@ struct list_node *add_list_node(struct list_node *head, void *data) return new_node; } -int is_list_empty(struct list_node *head) -{ +int is_list_empty(struct list_node* head) { return (head == NULL || head->next == NULL); } /* * Delink and de-allocate 'node'. */ -int remove_list_node(struct list_node *head, struct list_node *del_node) -{ - struct list_node *current_node; - struct list_node *saved_node; +int remove_list_node(struct list_node* head, struct list_node* del_node) { + struct list_node* current_node; + struct list_node* saved_node; if (head == NULL || head->next == NULL) { return -1; @@ -107,12 +102,10 @@ int remove_list_node(struct list_node *head, struct list_node *del_node) return 0; } -void dump_list(struct list_node *head) -{ - struct list_node *current_node = head; +void dump_list(struct list_node* head) { + struct list_node* current_node = head; - if (head == NULL) - return; + if (head == NULL) return; ALOGV("List:\n"); @@ -123,17 +116,14 @@ void dump_list(struct list_node *head) } } -struct list_node *find_node(struct list_node *head, void *comparison_data) -{ - struct list_node *current_node = head; +struct list_node* find_node(struct list_node* head, void* comparison_data) { + struct list_node* current_node = head; - if (head == NULL) - return NULL; + if (head == NULL) return NULL; while ((current_node = current_node->next)) { if (current_node->compare) { - if (current_node->compare(current_node->data, - comparison_data) == 0) { + if (current_node->compare(current_node->data, comparison_data) == 0) { /* Match found. Return current_node. */ return current_node; } -- cgit v1.2.3