[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181005142826.26108-3-linux@rasmusvillemoes.dk>
Date: Fri, 5 Oct 2018 16:28:26 +0200
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: "Bryan O'Donoghue" <pure.logic@...us-software.ie>,
Johan Hovold <johan@...nel.org>, Alex Elder <elder@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Rasmus Villemoes <linux@...musvillemoes.dk>,
greybus-dev@...ts.linaro.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 3/3] staging: greybus: loopback.c: simplify prototype of gb_loopback_bus_id_compare
gb_loopback_bus_id_compare only has a single caller, and it no longer
needs to have a prototype compatible with being a callback for
list_sort.
Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>
---
drivers/staging/greybus/loopback.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
index 89c3f6fd8ddf..2c7bad66bb31 100644
--- a/drivers/staging/greybus/loopback.c
+++ b/drivers/staging/greybus/loopback.c
@@ -987,11 +987,8 @@ static const struct file_operations gb_loopback_debugfs_latency_ops = {
.release = single_release,
};
-static int gb_loopback_bus_id_compare(void *priv, struct list_head *lha,
- struct list_head *lhb)
+static int gb_loopback_bus_id_compare(struct gb_loopback *a, struct gb_loopback *b)
{
- struct gb_loopback *a = list_entry(lha, struct gb_loopback, entry);
- struct gb_loopback *b = list_entry(lhb, struct gb_loopback, entry);
struct gb_connection *ca = a->connection;
struct gb_connection *cb = b->connection;
@@ -1022,7 +1019,7 @@ static void gb_loopback_insert_id(struct gb_loopback *gb)
* and we thus insert at the end.
*/
list_for_each_entry(gb_list, &gb_dev.list, entry) {
- if (gb_loopback_bus_id_compare(NULL, &gb->entry, &gb_list->entry) < 0)
+ if (gb_loopback_bus_id_compare(gb, gb_list) < 0)
break;
}
list_add_tail(&gb->entry, &gb_list->entry);
--
2.19.0
Powered by blists - more mailing lists