Merge pull request #29704 from mrc0mmand/cocci

Another round of Coccinelle tweaks
This commit is contained in:
Luca Boccassi
2023-10-25 13:42:21 +01:00
committed by GitHub
6 changed files with 10 additions and 6 deletions
+5 -1
View File
@@ -13,9 +13,13 @@ expression x, p, l;
- x.iov_len = l;
+ x = IOVEC_MAKE(p, l);
@@
/* Don't run this transformation on iovec_done() and iovec_done_erase(),
* since the result, albeit correct, is a bit funky. */
position pos : script:python() { pos[0].current_element != "iovec_done" and
pos[0].current_element != "iovec_done_erase" };
expression x, p, l;
@@
- x->iov_base = p;
- x->iov_base@pos = p;
- x->iov_len = l;
+ *x = IOVEC_MAKE(p, l);
@@
+1 -1
View File
@@ -5390,7 +5390,7 @@ int unit_set_exec_params(Unit *u, ExecParameters *p) {
p->received_credentials_directory = u->manager->received_credentials_directory;
p->received_encrypted_credentials_directory = u->manager->received_encrypted_credentials_directory;
p->shall_confirm_spawn = !!u->manager->confirm_spawn;
p->shall_confirm_spawn = u->manager->confirm_spawn;
p->fallback_smack_process_label = u->manager->defaults.smack_process_label;
+1 -1
View File
@@ -318,7 +318,7 @@ static int parse_lines(const char *arg, bool graceful) {
}
arg_lines = n;
arg_lines_oldest = !!l;
arg_lines_oldest = l;
return 1;
+1 -1
View File
@@ -593,7 +593,7 @@ int sd_ndisc_router_route_get_preference(sd_ndisc_router *rt, unsigned *ret) {
return r;
if (!IN_SET((ri[3] >> 3) & 3, SD_NDISC_PREFERENCE_LOW, SD_NDISC_PREFERENCE_MEDIUM, SD_NDISC_PREFERENCE_HIGH))
return -ENOTSUP;
return -EOPNOTSUPP;
*ret = (ri[3] >> 3) & 3;
return 0;
+1 -1
View File
@@ -1607,7 +1607,7 @@ int config_parse_router_home_agent_lifetime(
return 0;
}
if (usec == USEC_INFINITY || usec == 0 ||
if (!timestamp_is_set(usec) ||
usec > RADV_HOME_AGENT_MAX_LIFETIME_USEC) {
log_syntax(unit, LOG_WARNING, filename, line, 0,
"Invalid [%s] %s=, ignoring assignment: %s", section, lvalue, rvalue);
+1 -1
View File
@@ -921,7 +921,7 @@ static int get_usb_specifier(sd_device *dev, char **ret) {
return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EINVAL),
"sysname \"%s\" does not have '-' in the expected place.", sysname);
ports = strdupa(s + 1);
ports = strdupa_safe(s + 1);
s = strchr(ports, ':');
if (!s)
return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EINVAL),