1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00

network: can: shorten code a bit

This commit is contained in:
Yu Watanabe 2021-04-30 07:06:28 +09:00
parent ed52cce33f
commit e361398e48

View File

@ -252,21 +252,13 @@ int link_configure_can(Link *link) {
if (streq_ptr(link->kind, "can")) { if (streq_ptr(link->kind, "can")) {
/* The CAN interface must be down to configure bitrate, etc... */ /* The CAN interface must be down to configure bitrate, etc... */
if ((link->flags & IFF_UP)) { if ((link->flags & IFF_UP))
r = link_down(link, link_down_handler); r = link_down(link, link_down_handler);
if (r < 0) { else
link_enter_failed(link);
return r;
}
} else {
r = link_set_can(link); r = link_set_can(link);
if (r < 0) { if (r < 0)
link_enter_failed(link); link_enter_failed(link);
return r; return r;
}
}
return 0;
} }
if (!(link->flags & IFF_UP)) { if (!(link->flags & IFF_UP)) {