aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2021-12-09 00:15:56 +1000
committerCédric Le Goater <clg@kaod.org>2021-12-09 08:44:38 +0100
commit73b8206a9155ffe68ac86d2d182da784480deef9 (patch)
treef36ade98c05edfe50805307bd6a3a40caada1097
parente7569d0553b24c513d3066391973dd91b88c14ed (diff)
downloadskiboot-73b8206a9155ffe68ac86d2d182da784480deef9.zip
skiboot-73b8206a9155ffe68ac86d2d182da784480deef9.tar.gz
skiboot-73b8206a9155ffe68ac86d2d182da784480deef9.tar.bz2
ccan: switch list_add_before/after arguments to match upstream
Upstream ccan uses (list, existing entry, new entry) parameter ordering rather than (list, new entry, existing entry) ordering. Switch these to make syncing with upstream simpler. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Cédric Le Goater <clg@kaod.org>
-rw-r--r--ccan/list/list.h12
-rw-r--r--core/device.c2
-rw-r--r--core/mem_region.c4
-rw-r--r--core/timer.c2
-rw-r--r--hw/xscom.c2
5 files changed, 11 insertions, 11 deletions
diff --git a/ccan/list/list.h b/ccan/list/list.h
index 1d75dd9..6dbaabf 100644
--- a/ccan/list/list.h
+++ b/ccan/list/list.h
@@ -167,13 +167,13 @@ static inline void list_add(struct list_head *h, struct list_node *n)
/**
* list_add_before - add an entry before another entry.
* @h: the list_head to add the node to (we use it for debug purposes, can be NULL)
- * @n: the list_node to add to the list.
* @p: the list_node of the other entry
+ * @n: the list_node to add to the list.
*
* The list_node does not need to be initialized; it will be overwritten.
*/
-static inline void list_add_before(struct list_head *h, struct list_node *n,
- struct list_node *p)
+static inline void list_add_before(struct list_head *h, struct list_node *p,
+ struct list_node *n)
{
n->next = p;
n->prev = p->prev;
@@ -186,13 +186,13 @@ static inline void list_add_before(struct list_head *h, struct list_node *n,
/**
* list_add_after - add an entry after another entry.
* @h: the list_head to add the node to (we use it for debug purposes, can be NULL)
- * @n: the list_node to add to the list.
* @p: the list_node of the other entry
+ * @n: the list_node to add to the list.
*
* The list_node does not need to be initialized; it will be overwritten.
*/
-static inline void list_add_after(struct list_head *h, struct list_node *n,
- struct list_node *p)
+static inline void list_add_after(struct list_head *h, struct list_node *p,
+ struct list_node *n)
{
n->next = p->next;
n->prev = p;
diff --git a/core/device.c b/core/device.c
index b102dd9..2de37c7 100644
--- a/core/device.c
+++ b/core/device.c
@@ -120,7 +120,7 @@ bool dt_attach_root(struct dt_node *parent, struct dt_node *root)
break;
}
- list_add_before(&parent->children, &root->list, &node->list);
+ list_add_before(&parent->children, &node->list, &root->list);
root->parent = parent;
return true;
diff --git a/core/mem_region.c b/core/mem_region.c
index 36de2d0..e78d0a9 100644
--- a/core/mem_region.c
+++ b/core/mem_region.c
@@ -734,7 +734,7 @@ static bool maybe_split(struct mem_region *r, uint64_t split_at)
return false;
/* Tail add is important: we may need to split again! */
- list_add_after(&regions, &tail->list, &r->list);
+ list_add_after(&regions, &r->list, &tail->list);
return true;
}
@@ -771,7 +771,7 @@ static void add_region_to_regions(struct mem_region *region)
if (r->start < region->start)
continue;
- list_add_before(&regions, &region->list, &r->list);
+ list_add_before(&regions, &r->list, &region->list);
return;
}
list_add_tail(&regions, &region->list);
diff --git a/core/timer.c b/core/timer.c
index 652ffba..43c3883 100644
--- a/core/timer.c
+++ b/core/timer.c
@@ -121,7 +121,7 @@ static void __schedule_timer_at(struct timer *t, uint64_t when)
list_for_each(&timer_list, lt, link) {
if (when >= lt->target)
continue;
- list_add_before(&timer_list, &t->link, &lt->link);
+ list_add_before(&timer_list, &lt->link, &t->link);
goto bail;
}
list_add_tail(&timer_list, &t->link);
diff --git a/hw/xscom.c b/hw/xscom.c
index 298fe0c..530ac95 100644
--- a/hw/xscom.c
+++ b/hw/xscom.c
@@ -616,7 +616,7 @@ int64_t scom_register(struct scom_controller *new)
}
if (cur->part_id > new->part_id) {
- list_add_before(&scom_list, &new->link, &cur->link);
+ list_add_before(&scom_list, &cur->link, &new->link);
return 0;
}
}