treewide: Prefer not using assignment in if

This commit is contained in:
Denis Kenzior 2022-01-11 10:57:24 -06:00
parent 6ae1917733
commit 8b9442efe0
3 changed files with 14 additions and 10 deletions

View File

@ -236,7 +236,8 @@ static char **netconfig_get_dns_list(struct netconfig *netconfig, int af,
return dns_list;
}
if (!(lease = l_dhcp_client_get_lease(netconfig->dhcp_client)))
lease = l_dhcp_client_get_lease(netconfig->dhcp_client);
if (!lease)
return NULL;
return l_dhcp_lease_get_dns(lease);
@ -264,8 +265,8 @@ static char **netconfig_get_dns_list(struct netconfig *netconfig, int af,
return dns_list;
}
if (!(lease = l_dhcp6_client_get_lease(
netconfig->dhcp6_client)))
lease = l_dhcp6_client_get_lease(netconfig->dhcp6_client);
if (!lease)
return NULL;
return l_dhcp6_lease_get_dns(lease);
@ -1225,9 +1226,9 @@ static bool netconfig_ipv4_select_and_install(struct netconfig *netconfig)
if (unlikely(!addr_str))
return false;
if (L_WARN_ON(unlikely(!(netconfig->v4_address =
l_rtnl_address_new(addr_str,
prefix_len)))))
netconfig->v4_address = l_rtnl_address_new(addr_str,
prefix_len);
if (L_WARN_ON(!netconfig->v4_address))
return false;
l_rtnl_address_set_noprefixroute(netconfig->v4_address, true);

View File

@ -3106,7 +3106,8 @@ static void netdev_authenticate_event(struct l_genl_msg *msg,
const struct mmpdu_authentication *auth;
bool retry;
if (L_WARN_ON(!(hdr = mpdu_validate(frame, frame_len))))
hdr = mpdu_validate(frame, frame_len);
if (L_WARN_ON(!hdr))
goto auth_error;
auth = mmpdu_body(hdr);
@ -3216,7 +3217,8 @@ static void netdev_associate_event(struct l_genl_msg *msg,
const struct mmpdu_header *hdr;
const struct mmpdu_association_response *assoc;
if (L_WARN_ON(!(hdr = mpdu_validate(frame, frame_len))))
hdr = mpdu_validate(frame, frame_len);
if (L_WARN_ON(!hdr))
goto assoc_failed;
assoc = mmpdu_body(hdr);

View File

@ -1066,8 +1066,9 @@ static size_t p2p_group_write_p2p_ie(struct p2p_device *dev,
* Response frame if the received Probe Request frame does
* not contain a P2P IE."
*/
if (!(tmp = ie_tlv_extract_p2p_payload(req->ies, req_ies_len,
&req_p2p_data_size)))
tmp = ie_tlv_extract_p2p_payload(req->ies, req_ies_len,
&req_p2p_data_size);
if (!tmp)
return 0;
info.capability = dev->capability;