[libvirt] [PATCH] rpc: Remove duplicate check from filter function return.

Julio Faracco posted 1 patch 5 years, 5 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20181114174900.20656-1-jcfaracco@gmail.com
src/rpc/virnetserverclient.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[libvirt] [PATCH] rpc: Remove duplicate check from filter function return.
Posted by Julio Faracco 5 years, 5 months ago
This is a simple removal of a duplicated check of the return of the
filter function. There is a nested conditional checking exactly the same
thing.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
---
 src/rpc/virnetserverclient.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index 97cf126f56..778cd1afc0 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -1288,8 +1288,7 @@ static virNetMessagePtr virNetServerClientDispatchRead(virNetServerClientPtr cli
                 if (ret < 0) {
                     virNetMessageFree(msg);
                     msg = NULL;
-                    if (ret < 0)
-                        client->wantClose = true;
+                    client->wantClose = true;
                     break;
                 }
                 if (ret > 0) {
-- 
2.19.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] rpc: Remove duplicate check from filter function return.
Posted by John Ferlan 5 years, 5 months ago

On 11/14/18 12:49 PM, Julio Faracco wrote:
> This is a simple removal of a duplicated check of the return of the
> filter function. There is a nested conditional checking exactly the same
> thing.

s/./ since commit c9ede1cf removed the (ret > 0) check condition./

> 
> Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
> ---
>  src/rpc/virnetserverclient.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 


Reviewed-by: John Ferlan <jferlan@redhat.com>

John

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list