diff mbox series

net/colo-compare.c: Remove duplicated code

Message ID 20190114140510.7161-1-chen.zhang@intel.com
State New
Headers show
Series net/colo-compare.c: Remove duplicated code | expand

Commit Message

Zhang, Chen Jan. 14, 2019, 2:05 p.m. UTC
From: Zhang Chen <chen.zhang@intel.com>

Fix duplicated code:
https://bugs.launchpad.net/qemu/+bug/1811499

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
---
 net/colo-compare.c | 8 --------
 1 file changed, 8 deletions(-)

Comments

Philippe Mathieu-Daudé Jan. 14, 2019, 4:44 p.m. UTC | #1
On 1/14/19 3:30 PM, Thomas Huth wrote:
> On 2019-01-14 15:05, Zhang Chen wrote:
>> From: Zhang Chen <chen.zhang@intel.com>
>>
>> Fix duplicated code:
>> https://bugs.launchpad.net/qemu/+bug/1811499
>>

Fixes: f449c9e549c

>> Signed-off-by: Zhang Chen <chen.zhang@intel.com>
>> ---
>>  net/colo-compare.c | 8 --------
>>  1 file changed, 8 deletions(-)
>>
>> diff --git a/net/colo-compare.c b/net/colo-compare.c
>> index 9156ab3349..fa3fd0632d 100644
>> --- a/net/colo-compare.c
>> +++ b/net/colo-compare.c
>> @@ -285,14 +285,6 @@ static bool colo_mark_tcp_pkt(Packet *ppkt, Packet *spkt,
>>  {
>>      *mark = 0;
>>  
>> -    if (ppkt->tcp_seq == spkt->tcp_seq && ppkt->seq_end == spkt->seq_end) {
>> -        if (colo_compare_packet_payload(ppkt, spkt,
>> -                                        ppkt->header_size, spkt->header_size,
>> -                                        ppkt->payload_size)) {
>> -            *mark = COLO_COMPARE_FREE_SECONDARY | COLO_COMPARE_FREE_PRIMARY;
>> -            return true;
>> -        }
>> -    }
>>      if (ppkt->tcp_seq == spkt->tcp_seq && ppkt->seq_end == spkt->seq_end) {
>>          if (colo_compare_packet_payload(ppkt, spkt,
>>                                          ppkt->header_size, spkt->header_size,
>>
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Jason Wang Jan. 15, 2019, 8:06 a.m. UTC | #2
On 2019/1/15 上午12:44, Philippe Mathieu-Daudé wrote:
> On 1/14/19 3:30 PM, Thomas Huth wrote:
>> On 2019-01-14 15:05, Zhang Chen wrote:
>>> From: Zhang Chen <chen.zhang@intel.com>
>>>
>>> Fix duplicated code:
>>> https://bugs.launchpad.net/qemu/+bug/1811499
>>>
> Fixes: f449c9e549c
>
>>> Signed-off-by: Zhang Chen <chen.zhang@intel.com>
>>> ---
>>>   net/colo-compare.c | 8 --------
>>>   1 file changed, 8 deletions(-)
>>>
>>> diff --git a/net/colo-compare.c b/net/colo-compare.c
>>> index 9156ab3349..fa3fd0632d 100644
>>> --- a/net/colo-compare.c
>>> +++ b/net/colo-compare.c
>>> @@ -285,14 +285,6 @@ static bool colo_mark_tcp_pkt(Packet *ppkt, Packet *spkt,
>>>   {
>>>       *mark = 0;
>>>   
>>> -    if (ppkt->tcp_seq == spkt->tcp_seq && ppkt->seq_end == spkt->seq_end) {
>>> -        if (colo_compare_packet_payload(ppkt, spkt,
>>> -                                        ppkt->header_size, spkt->header_size,
>>> -                                        ppkt->payload_size)) {
>>> -            *mark = COLO_COMPARE_FREE_SECONDARY | COLO_COMPARE_FREE_PRIMARY;
>>> -            return true;
>>> -        }
>>> -    }
>>>       if (ppkt->tcp_seq == spkt->tcp_seq && ppkt->seq_end == spkt->seq_end) {
>>>           if (colo_compare_packet_payload(ppkt, spkt,
>>>                                           ppkt->header_size, spkt->header_size,
>>>
>> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>

Applied.

Thanks
diff mbox series

Patch

diff --git a/net/colo-compare.c b/net/colo-compare.c
index 9156ab3349..fa3fd0632d 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -285,14 +285,6 @@  static bool colo_mark_tcp_pkt(Packet *ppkt, Packet *spkt,
 {
     *mark = 0;
 
-    if (ppkt->tcp_seq == spkt->tcp_seq && ppkt->seq_end == spkt->seq_end) {
-        if (colo_compare_packet_payload(ppkt, spkt,
-                                        ppkt->header_size, spkt->header_size,
-                                        ppkt->payload_size)) {
-            *mark = COLO_COMPARE_FREE_SECONDARY | COLO_COMPARE_FREE_PRIMARY;
-            return true;
-        }
-    }
     if (ppkt->tcp_seq == spkt->tcp_seq && ppkt->seq_end == spkt->seq_end) {
         if (colo_compare_packet_payload(ppkt, spkt,
                                         ppkt->header_size, spkt->header_size,