return -ENOMEM;
*sr_iov = (SRIOV) {
- .vf = (uint32_t) -1,
+ .vf = UINT32_MAX,
.vlan_proto = ETH_P_8021Q,
.vf_spoof_check_setting = -1,
.trust = -1,
sr_iov->network = network;
sr_iov->section = TAKE_PTR(n);
- r = ordered_hashmap_ensure_allocated(&network->sr_iov_by_section, &network_config_hash_ops);
- if (r < 0)
- return r;
-
- r = ordered_hashmap_put(network->sr_iov_by_section, sr_iov->section, sr_iov);
+ r = ordered_hashmap_ensure_put(&network->sr_iov_by_section, &network_config_hash_ops, sr_iov->section, sr_iov);
if (r < 0)
return r;
if (section_is_invalid(sr_iov->section))
return -EINVAL;
- if (sr_iov->vf == (uint32_t) -1)
+ if (sr_iov->vf == UINT32_MAX)
return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
"%s: [SRIOV] section without VirtualFunction= field configured. "
"Ignoring [SRIOV] section from line %u.",
if (isempty(rvalue)) {
if (streq(lvalue, "VirtualFunction"))
- sr_iov->vf = (uint32_t) -1;
+ sr_iov->vf = UINT32_MAX;
else if (streq(lvalue, "VLANId"))
sr_iov->vlan = 0;
else if (streq(lvalue, "QualityOfService"))