All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] hwdb: Remove unutilized return value
@ 2016-08-02 19:21 Mat Martineau
  2016-08-02 19:21 ` [PATCH 2/2] hwdb: Optimize lookup execution Mat Martineau
  2016-08-03 22:05 ` [PATCH 1/2] hwdb: Remove unutilized return value Denis Kenzior
  0 siblings, 2 replies; 4+ messages in thread
From: Mat Martineau @ 2016-08-02 19:21 UTC (permalink / raw)
  To: ell

[-- Attachment #1: Type: text/plain, Size: 1759 bytes --]

trie_fnmatch always returned 0. Make it return void instead.
---
 ell/hwdb.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/ell/hwdb.c b/ell/hwdb.c
index caa8eb3..b251f27 100644
--- a/ell/hwdb.c
+++ b/ell/hwdb.c
@@ -198,8 +198,9 @@ LIB_EXPORT void l_hwdb_unref(struct l_hwdb *hwdb)
 	l_free(hwdb);
 }
 
-static int trie_fnmatch(const void *addr, uint64_t offset, const char *prefix,
-			const char *string, struct l_hwdb_entry **entries)
+static void trie_fnmatch(const void *addr, uint64_t offset, const char *prefix,
+				const char *string,
+				struct l_hwdb_entry **entries)
 {
 	const struct trie_node *node = addr + offset;
 	const void *addr_ptr = addr + offset + sizeof(*node);
@@ -217,25 +218,22 @@ static int trie_fnmatch(const void *addr, uint64_t offset, const char *prefix,
 
 	for (i = 0; i < child_count; i++) {
 		const struct trie_child *child = addr_ptr;
-		int err;
 
 		scratch_buf[scratch_len] = child->c;
 
-		err = trie_fnmatch(addr, le64_to_cpu(child->child_offset),
-						scratch_buf, string, entries);
-		if (err)
-			return err;
+		trie_fnmatch(addr, le64_to_cpu(child->child_offset),
+				scratch_buf, string, entries);
 
 		addr_ptr += sizeof(*child);
 	}
 
 	if (!entry_count)
-		return 0;
+		return;
 
 	scratch_buf[scratch_len] = '\0';
 
 	if (fnmatch(scratch_buf, string, 0))
-		return 0;
+		return;
 
 	for (i = 0; i < entry_count; i++) {
 		const struct trie_entry *entry = addr_ptr;
@@ -254,8 +252,6 @@ static int trie_fnmatch(const void *addr, uint64_t offset, const char *prefix,
 
 		addr_ptr += sizeof(*entry);
 	}
-
-	return 0;
 }
 
 LIB_EXPORT struct l_hwdb_entry *l_hwdb_lookup(struct l_hwdb *hwdb,
-- 
2.9.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-03 22:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-02 19:21 [PATCH 1/2] hwdb: Remove unutilized return value Mat Martineau
2016-08-02 19:21 ` [PATCH 2/2] hwdb: Optimize lookup execution Mat Martineau
2016-08-03 18:20   ` Mat Martineau
2016-08-03 22:05 ` [PATCH 1/2] hwdb: Remove unutilized return value Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.