mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-21 18:24:49 +00:00
platform: minor cleanup of event_seq_check()
- unindent the code by "continue" the loop for the irrelevant case. - fix indentation of comments. - avoid unnecessary g_strdup() call if the extack message is NULL.
This commit is contained in:
parent
1d69b41db9
commit
bb9894abec
|
@ -7750,19 +7750,22 @@ event_seq_check(NMPlatform *platform,
|
|||
DelayedActionWaitForNlResponseData *data =
|
||||
delayed_action_get_list_wait_for_resonse(priv, netlink_protocol, i);
|
||||
|
||||
if (data->seq_number == seq_number) {
|
||||
/* We potentially receive many parts partial responses for the same sequence number.
|
||||
* Thus, we only remember the result, and collect it later. */
|
||||
if (data->seq_result < 0) {
|
||||
/* we already saw an error for this sequence number.
|
||||
* Preserve it. */
|
||||
} else if (seq_result != WAIT_FOR_NL_RESPONSE_RESULT_RESPONSE_UNKNOWN
|
||||
|| data->seq_result == WAIT_FOR_NL_RESPONSE_RESULT_UNKNOWN)
|
||||
data->seq_result = seq_result;
|
||||
if (data->out_extack_msg && !*data->out_extack_msg)
|
||||
*data->out_extack_msg = g_strdup(extack_msg);
|
||||
return;
|
||||
}
|
||||
if (data->seq_number != seq_number)
|
||||
continue;
|
||||
|
||||
/* We potentially receive many parts partial responses for the same sequence number.
|
||||
* Thus, we only remember the result, and collect it later. */
|
||||
if (data->seq_result < 0) {
|
||||
/* we already saw an error for this sequence number.
|
||||
* Preserve it. */
|
||||
} else if (seq_result != WAIT_FOR_NL_RESPONSE_RESULT_RESPONSE_UNKNOWN
|
||||
|| data->seq_result == WAIT_FOR_NL_RESPONSE_RESULT_UNKNOWN)
|
||||
data->seq_result = seq_result;
|
||||
|
||||
if (extack_msg && data->out_extack_msg && !*data->out_extack_msg)
|
||||
*data->out_extack_msg = g_strdup(extack_msg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
out:
|
||||
|
|
Loading…
Reference in a new issue