summaryrefslogtreecommitdiff
path: root/kernel/old/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/old/list.c')
-rw-r--r--kernel/old/list.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/kernel/old/list.c b/kernel/old/list.c
index 5492615..084000a 100644
--- a/kernel/old/list.c
+++ b/kernel/old/list.c
@@ -29,11 +29,11 @@
** @param[in,out] list The address of a list_t variable
** @param[in] data The data to prepend to the list
*/
-void list_add(list_t *list, void *data)
-{
+void list_add( list_t *list, void *data ) {
+
// sanity checks
- assert1(list != NULL);
- assert1(data != NULL);
+ assert1( list != NULL );
+ assert1( data != NULL );
list_t *tmp = (list_t *)data;
tmp->next = list->next;
@@ -49,15 +49,16 @@ void list_add(list_t *list, void *data)
**
** @return a pointer to the removed data, or NULL if the list was empty
*/
-void *list_remove(list_t *list)
-{
- assert1(list != NULL);
+void *list_remove( list_t *list ) {
+
+ assert1( list != NULL );
list_t *data = list->next;
- if (data != NULL) {
+ if( data != NULL ) {
list->next = data->next;
data->next = NULL;
}
return (void *)data;
}
+