summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-11-29 14:42:57 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-11-29 20:34:08 -0500
commit0f2e01a503d5763087da95d7a001cf84f190d19b (patch)
tree0a823623ffdae77224435c4d82102ee6b282af9e
parent97506e85e2cf8c726939a872239698d5279a1cfc (diff)
Two small cleanups
-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;