diff mbox series

[3/3] colo-compare: check mark in mutual exclusion

Message ID 20200922095525.4081603-4-lizhijian@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show
Series colo-compare: minor fixes | expand

Commit Message

Li Zhijian Sept. 22, 2020, 9:55 a.m. UTC
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
 net/colo-compare.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Zhang Chen Sept. 23, 2020, 1:46 a.m. UTC | #1
> -----Original Message-----
> From: Li Zhijian <lizhijian@cn.fujitsu.com>
> Sent: Tuesday, September 22, 2020 5:55 PM
> To: Zhang, Chen <chen.zhang@intel.com>; jasowang@redhat.com
> Cc: qemu-devel@nongnu.org; Li Zhijian <lizhijian@cn.fujitsu.com>
> Subject: [PATCH 3/3] colo-compare: check mark in mutual exclusion
> 
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>

Reviewed-by: Zhang Chen <chen.zhang@intel.com>
By the way, we have other optimization here, will be sent in the future.

Thanks
Zhang Chen

> ---
>  net/colo-compare.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/net/colo-compare.c b/net/colo-compare.c index
> 039b515611..19633fc684 100644
> --- a/net/colo-compare.c
> +++ b/net/colo-compare.c
> @@ -481,13 +481,11 @@ sec:
>              colo_release_primary_pkt(s, ppkt);
>              g_queue_push_head(&conn->secondary_list, spkt);
>              goto pri;
> -        }
> -        if (mark == COLO_COMPARE_FREE_SECONDARY) {
> +        } else if (mark == COLO_COMPARE_FREE_SECONDARY) {
>              conn->compare_seq = spkt->seq_end;
>              packet_destroy(spkt, NULL);
>              goto sec;
> -        }
> -        if (mark == (COLO_COMPARE_FREE_PRIMARY |
> COLO_COMPARE_FREE_SECONDARY)) {
> +        } else if (mark == (COLO_COMPARE_FREE_PRIMARY |
> + COLO_COMPARE_FREE_SECONDARY)) {
>              conn->compare_seq = ppkt->seq_end;
>              colo_release_primary_pkt(s, ppkt);
>              packet_destroy(spkt, NULL);
> --
> 2.28.0
> 
>
diff mbox series

Patch

diff --git a/net/colo-compare.c b/net/colo-compare.c
index 039b515611..19633fc684 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -481,13 +481,11 @@  sec:
             colo_release_primary_pkt(s, ppkt);
             g_queue_push_head(&conn->secondary_list, spkt);
             goto pri;
-        }
-        if (mark == COLO_COMPARE_FREE_SECONDARY) {
+        } else if (mark == COLO_COMPARE_FREE_SECONDARY) {
             conn->compare_seq = spkt->seq_end;
             packet_destroy(spkt, NULL);
             goto sec;
-        }
-        if (mark == (COLO_COMPARE_FREE_PRIMARY | COLO_COMPARE_FREE_SECONDARY)) {
+        } else if (mark == (COLO_COMPARE_FREE_PRIMARY | COLO_COMPARE_FREE_SECONDARY)) {
             conn->compare_seq = ppkt->seq_end;
             colo_release_primary_pkt(s, ppkt);
             packet_destroy(spkt, NULL);