tree-wide: code improvements suggested by Coccinelle

This commit is contained in:
Frantisek Sumsal
2019-04-30 09:39:07 +02:00
parent 4a4eaade60
commit ed0cb34682
11 changed files with 57 additions and 52 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ int dns_label_unescape(const char **name, char *dest, size_t sz, DNSLabelFlags f
d = dest;
for (;;) {
if (*n == 0 || *n == '.') {
if (IN_SET(*n, 0, '.')) {
if (FLAGS_SET(flags, DNS_LABEL_LDH) && last_char == '-')
/* Trailing dash */
return -EINVAL;
+1 -1
View File
@@ -395,7 +395,7 @@ static int image_make(
if (r < 0)
return r;
if (size != 0 && size != UINT64_MAX)
if (!IN_SET(size, 0, UINT64_MAX))
(*ret)->usage = (*ret)->usage_exclusive = (*ret)->limit = (*ret)->limit_exclusive = size;
return 0;