Blame SOURCES/libiscsi-sync-remove-unnecessary-checks.patch

a9f19d
From cc34aab2a455546431da8e8abb0d854a70c71962 Mon Sep 17 00:00:00 2001
a9f19d
From: Paolo Bonzini <pbonzini@redhat.com>
a9f19d
Date: Tue, 9 Oct 2018 15:14:16 +0100
a9f19d
Subject: [PATCH 3/6] sync: remove unnecessary checks
a9f19d
a9f19d
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
a9f19d
Message-id: <20181009151419.20418-4-pbonzini@redhat.com>
a9f19d
Patchwork-id: 82506
a9f19d
O-Subject: [RHEL8 libiscsi PATCH 3/6] sync: remove unnecessary checks
a9f19d
Bugzilla: 1634541
a9f19d
RH-Acked-by: Thomas Huth <thuth@redhat.com>
a9f19d
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
a9f19d
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
a9f19d
a9f19d
state is always non-NULL in iscsi_sync_cb and iscsi_discovery_cb.
a9f19d
a9f19d
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
a9f19d
(cherry picked from commit f507c94774bff0c851880813d95f5d0a8fbdace8)
a9f19d
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
a9f19d
---
a9f19d
 lib/sync.c | 14 +++++---------
a9f19d
 1 file changed, 5 insertions(+), 9 deletions(-)
a9f19d
a9f19d
diff --git a/lib/sync.c b/lib/sync.c
a9f19d
index 9fb78e7..34ed64e 100644
a9f19d
--- a/lib/sync.c
a9f19d
+++ b/lib/sync.c
a9f19d
@@ -85,10 +85,8 @@ iscsi_sync_cb(struct iscsi_context *iscsi _U_, int status,
a9f19d
 {
a9f19d
 	struct iscsi_sync_state *state = private_data;
a9f19d
 
a9f19d
-	if (state != NULL) {
a9f19d
-		state->status    = status;
a9f19d
-		state->finished = 1;
a9f19d
-	}
a9f19d
+	state->status    = status;
a9f19d
+	state->finished = 1;
a9f19d
 }
a9f19d
 
a9f19d
 int
a9f19d
@@ -1818,11 +1816,9 @@ iscsi_discovery_cb(struct iscsi_context *iscsi _U_, int status,
a9f19d
                 }
a9f19d
         }
a9f19d
 
a9f19d
-	if (state != NULL) {
a9f19d
-		state->status    = status;
a9f19d
-		state->finished = 1;
a9f19d
-                state->ptr = dahead;
a9f19d
-	}
a9f19d
+	state->status    = status;
a9f19d
+	state->finished = 1;
a9f19d
+	state->ptr = dahead;
a9f19d
 }
a9f19d
 
a9f19d
 struct iscsi_discovery_address *
a9f19d
-- 
a9f19d
1.8.3.1
a9f19d