1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

Merge pull request #18382 from yuwata/fix-downgrade-to-bool

sd-device,sd-netlink: trivial cleanups
This commit is contained in:
Lennart Poettering 2021-01-26 17:38:19 +01:00 committed by GitHub
commit 04a853848e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -231,8 +231,7 @@ _public_ int sd_device_new_from_syspath(sd_device **ret, const char *syspath) {
}
_public_ int sd_device_new_from_devnum(sd_device **ret, char type, dev_t devnum) {
char *syspath;
char id[DECIMAL_STR_MAX(unsigned) * 2 + 1];
char id[DECIMAL_STR_MAX(unsigned) * 2 + 1], *syspath;
assert_return(ret, -EINVAL);
assert_return(IN_SET(type, 'b', 'c'), -EINVAL);
@ -399,7 +398,7 @@ int device_set_devmode(sd_device *device, const char *_devmode) {
}
int device_set_devnum(sd_device *device, const char *major, const char *minor) {
unsigned maj = 0, min = 0;
unsigned maj, min = 0;
int r;
assert(device);
@ -408,7 +407,7 @@ int device_set_devnum(sd_device *device, const char *major, const char *minor) {
r = safe_atou(major, &maj);
if (r < 0)
return r;
if (!maj)
if (maj == 0)
return 0;
if (minor) {

View File

@ -462,7 +462,7 @@ int sd_rtnl_message_link_set_flags(sd_netlink_message *m, unsigned flags, unsign
assert_return(m, -EINVAL);
assert_return(m->hdr, -EINVAL);
assert_return(rtnl_message_type_is_link(m->hdr->nlmsg_type), -EINVAL);
assert_return(change, -EINVAL);
assert_return(change != 0, -EINVAL);
ifi = NLMSG_DATA(m->hdr);
@ -679,7 +679,7 @@ int sd_rtnl_message_new_addr(sd_netlink *rtnl, sd_netlink_message **ret,
}
int sd_rtnl_message_new_addr_update(sd_netlink *rtnl, sd_netlink_message **ret,
int index, int family) {
int index, int family) {
int r;
r = sd_rtnl_message_new_addr(rtnl, ret, RTM_NEWADDR, index, family);