summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/basic/util.c2
-rw-r--r--src/libsystemd/sd-hwdb/sd-hwdb.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/basic/util.c b/src/basic/util.c
index c1b5ca1ef7..d0424e5392 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -493,7 +493,7 @@ void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
u = nmemb;
while (l < u) {
idx = (l + u) / 2;
- p = (void *)(((const char *) base) + (idx * size));
+ p = (const char *) base + idx * size;
comparison = compar(key, p, arg);
if (comparison < 0)
u = idx;
diff --git a/src/libsystemd/sd-hwdb/sd-hwdb.c b/src/libsystemd/sd-hwdb/sd-hwdb.c
index 719e3505c1..811a60f0c3 100644
--- a/src/libsystemd/sd-hwdb/sd-hwdb.c
+++ b/src/libsystemd/sd-hwdb/sd-hwdb.c
@@ -234,7 +234,7 @@ static int trie_search_f(sd_hwdb *hwdb, const char *search) {
uint8_t c;
for (; (c = trie_string(hwdb, node->prefix_off)[p]); p++) {
- if (c == '*' || c == '?' || c == '[')
+ if (IN_SET(c, '*', '?', '['))
return trie_fnmatch_f(hwdb, node, p, &buf, search + i + p);
if (c != search[i + p])
return 0;