tree-wide: drop a few == NULL and != NULL comparison

Our CODING_STYLE suggests not comparing with NULL, but relying on C's
downgrade-to-bool feature for that. Fix up some code to match these
guidelines. (This is not comprehensive, the coccinelle output for this
is unfortunately kinda borked)
This commit is contained in:
Lennart Poettering
2017-12-11 16:05:40 +01:00
parent 4a0e9289bf
commit 234519ae6d
15 changed files with 37 additions and 23 deletions
+2 -2
View File
@@ -71,7 +71,7 @@ int ether_addr_from_string(const char *s, struct ether_addr *ret, size_t *offset
if (s[pos] == '\0') \
break; \
hexoff = strchr(hex, s[pos]); \
if (hexoff == NULL) \
if (!hexoff) \
break; \
assert(hexoff >= hex); \
x = hexoff - hex; \
@@ -99,7 +99,7 @@ int ether_addr_from_string(const char *s, struct ether_addr *ret, size_t *offset
sep = s[strspn(s, hex)];
if (sep == '\n')
return -EINVAL;
if (strchr(":.-", sep) == NULL)
if (!strchr(":.-", sep))
return -EINVAL;
if (sep == '.') {