tree-wide: some automatic coccinelle fixes (#10463)
Nothing fancy, just coccinelle doing its work.
This commit is contained in:
committed by
Yu Watanabe
parent
a4544f53c4
commit
490c5a37cb
@@ -2123,7 +2123,7 @@ int cg_create_everywhere(CGroupMask supported, CGroupMask mask, const char *path
|
||||
r = cg_create(SYSTEMD_CGROUP_CONTROLLER, path);
|
||||
if (r < 0)
|
||||
return r;
|
||||
created = !!r;
|
||||
created = r;
|
||||
|
||||
/* If we are in the unified hierarchy, we are done now */
|
||||
r = cg_all_unified();
|
||||
|
||||
+2
-3
@@ -1763,8 +1763,7 @@ static int json_parse_string(const char **p, char **ret) {
|
||||
|
||||
*p = c + 1;
|
||||
|
||||
*ret = s;
|
||||
s = NULL;
|
||||
*ret = TAKE_PTR(s);
|
||||
return JSON_TOKEN_STRING;
|
||||
}
|
||||
|
||||
@@ -1919,7 +1918,7 @@ static int json_parse_number(const char **p, JsonValue *ret) {
|
||||
} while (strchr("0123456789", *c) && *c != 0);
|
||||
}
|
||||
|
||||
if (*c == 'e' || *c == 'E') {
|
||||
if (IN_SET(*c, 'e', 'E')) {
|
||||
is_real = true;
|
||||
c++;
|
||||
|
||||
|
||||
@@ -280,7 +280,7 @@ static char *format_timestamp_internal(
|
||||
|
||||
/* Let's not format times with years > 9999 */
|
||||
if (t > USEC_TIMESTAMP_FORMATTABLE_MAX) {
|
||||
assert(l >= strlen("--- XXXX-XX-XX XX:XX:XX") + 1);
|
||||
assert(l >= STRLEN("--- XXXX-XX-XX XX:XX:XX") + 1);
|
||||
strcpy(buf, "--- XXXX-XX-XX XX:XX:XX");
|
||||
return buf;
|
||||
}
|
||||
@@ -1026,7 +1026,7 @@ int parse_time(const char *t, usec_t *usec, usec_t default_unit) {
|
||||
char *b = e + 1;
|
||||
|
||||
/* Don't allow "0.-0", "3.+1" or "3. 1" */
|
||||
if (*b == '-' || *b == '+' || isspace(*b))
|
||||
if (IN_SET(*b, '-', '+') || isspace(*b))
|
||||
return -EINVAL;
|
||||
|
||||
errno = 0;
|
||||
@@ -1164,7 +1164,7 @@ int parse_nsec(const char *t, nsec_t *nsec) {
|
||||
if (*e == '.') {
|
||||
char *b = e + 1;
|
||||
|
||||
if (*b == '-' || *b == '+' || isspace(*b))
|
||||
if (IN_SET(*b, '-', '+') || isspace(*b))
|
||||
return -EINVAL;
|
||||
|
||||
errno = 0;
|
||||
|
||||
Reference in New Issue
Block a user