Merge pull request #12420 from mrc0mmand/coccinelle-tweaks

Coccinelle improvements
This commit is contained in:
Lennart Poettering
2019-04-30 11:37:19 +02:00
committed by GitHub
40 changed files with 269 additions and 230 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
@@ -514,7 +514,7 @@ int efi_get_boot_option(
if (path)
*path = TAKE_PTR(p);
if (active)
*active = !!(header->attr & LOAD_OPTION_ACTIVE);
*active = header->attr & LOAD_OPTION_ACTIVE;
return 0;
}
+1 -1
View File
@@ -94,7 +94,7 @@ static int get_line(JournalImporter *imp, char **line, size_t *size) {
c = memchr(imp->buf + start, '\n',
imp->filled - start);
if (c != NULL)
if (c)
break;
}
+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;