Merge pull request #12420 from mrc0mmand/coccinelle-tweaks
Coccinelle improvements
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user