summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-02-17 11:42:45 +0100
committerThomas Haller <thaller@redhat.com>2023-02-28 12:08:06 +0100
commitbb9894abecb7f52f904d98fe6ed42fb8292a9eb3 (patch)
tree39c076271af6ad6477e24678caa91524cd5eeae8
parent1d69b41db92b084ac248e25d45d850c457833bd0 (diff)
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.
-rw-r--r--src/libnm-platform/nm-linux-platform.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/libnm-platform/nm-linux-platform.c b/src/libnm-platform/nm-linux-platform.c
index 04ac89cc89..4423b75ddb 100644
--- a/src/libnm-platform/nm-linux-platform.c
+++ b/src/libnm-platform/nm-linux-platform.c
@@ -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: