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:
@@ -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 == '.') {
|
||||
|
||||
Reference in New Issue
Block a user