mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 21:22:37 +01:00
treewide: Prefer not using assignment in if
This commit is contained in:
parent
6ae1917733
commit
8b9442efe0
@ -236,7 +236,8 @@ static char **netconfig_get_dns_list(struct netconfig *netconfig, int af,
|
|||||||
return dns_list;
|
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 NULL;
|
||||||
|
|
||||||
return l_dhcp_lease_get_dns(lease);
|
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;
|
return dns_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(lease = l_dhcp6_client_get_lease(
|
lease = l_dhcp6_client_get_lease(netconfig->dhcp6_client);
|
||||||
netconfig->dhcp6_client)))
|
if (!lease)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return l_dhcp6_lease_get_dns(lease);
|
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))
|
if (unlikely(!addr_str))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (L_WARN_ON(unlikely(!(netconfig->v4_address =
|
netconfig->v4_address = l_rtnl_address_new(addr_str,
|
||||||
l_rtnl_address_new(addr_str,
|
prefix_len);
|
||||||
prefix_len)))))
|
if (L_WARN_ON(!netconfig->v4_address))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
l_rtnl_address_set_noprefixroute(netconfig->v4_address, true);
|
l_rtnl_address_set_noprefixroute(netconfig->v4_address, true);
|
||||||
|
@ -3106,7 +3106,8 @@ static void netdev_authenticate_event(struct l_genl_msg *msg,
|
|||||||
const struct mmpdu_authentication *auth;
|
const struct mmpdu_authentication *auth;
|
||||||
bool retry;
|
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;
|
goto auth_error;
|
||||||
|
|
||||||
auth = mmpdu_body(hdr);
|
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_header *hdr;
|
||||||
const struct mmpdu_association_response *assoc;
|
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;
|
goto assoc_failed;
|
||||||
|
|
||||||
assoc = mmpdu_body(hdr);
|
assoc = mmpdu_body(hdr);
|
||||||
|
@ -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
|
* Response frame if the received Probe Request frame does
|
||||||
* not contain a P2P IE."
|
* not contain a P2P IE."
|
||||||
*/
|
*/
|
||||||
if (!(tmp = ie_tlv_extract_p2p_payload(req->ies, req_ies_len,
|
tmp = ie_tlv_extract_p2p_payload(req->ies, req_ies_len,
|
||||||
&req_p2p_data_size)))
|
&req_p2p_data_size);
|
||||||
|
if (!tmp)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
info.capability = dev->capability;
|
info.capability = dev->capability;
|
||||||
|
Loading…
Reference in New Issue
Block a user