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:
Thomas Haller
2023-02-17 11:42:45 +01:00
parent 1d69b41db9
commit bb9894abec

View File

@@ -7750,19 +7750,22 @@ event_seq_check(NMPlatform *platform,
DelayedActionWaitForNlResponseData *data = DelayedActionWaitForNlResponseData *data =
delayed_action_get_list_wait_for_resonse(priv, netlink_protocol, i); delayed_action_get_list_wait_for_resonse(priv, netlink_protocol, i);
if (data->seq_number == seq_number) { if (data->seq_number != seq_number)
/* We potentially receive many parts partial responses for the same sequence number. continue;
* Thus, we only remember the result, and collect it later. */
if (data->seq_result < 0) { /* We potentially receive many parts partial responses for the same sequence number.
/* we already saw an error for this sequence number. * Thus, we only remember the result, and collect it later. */
* Preserve it. */ if (data->seq_result < 0) {
} else if (seq_result != WAIT_FOR_NL_RESPONSE_RESULT_RESPONSE_UNKNOWN /* we already saw an error for this sequence number.
|| data->seq_result == WAIT_FOR_NL_RESPONSE_RESULT_UNKNOWN) * Preserve it. */
data->seq_result = seq_result; } else if (seq_result != WAIT_FOR_NL_RESPONSE_RESULT_RESPONSE_UNKNOWN
if (data->out_extack_msg && !*data->out_extack_msg) || data->seq_result == WAIT_FOR_NL_RESPONSE_RESULT_UNKNOWN)
*data->out_extack_msg = g_strdup(extack_msg); data->seq_result = seq_result;
return;
} if (extack_msg && data->out_extack_msg && !*data->out_extack_msg)
*data->out_extack_msg = g_strdup(extack_msg);
return;
} }
out: out: