From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: [PATCH 6/6] tools/libx{l, c}: Fix trivial Coverity defects in migration v2 code Date: Mon, 20 Jul 2015 11:37:59 +0100 Message-ID: <1437388679-16468-7-git-send-email-andrew.cooper3@citrix.com> References: <1437388679-16468-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1437388679-16468-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Andrew Cooper , Ian Jackson , Ian Campbell , Wei Liu List-Id: xen-devel@lists.xenproject.org All of these are UNUSED_VALUE defects where a default vaule is unconditionally overwritten. They are not particularly interesting, bug wise, but keeping these defects at bay helps prevent real bugs going unnoticed in the volume. No functional change. Signed-off-by: Andrew Cooper CC: Ian Campbell CC: Ian Jackson CC: Wei Liu --- tools/libxc/xc_sr_save.c | 10 +++++----- tools/libxl/libxl_stream_read.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c index 46700a1..79c389a 100644 --- a/tools/libxc/xc_sr_save.c +++ b/tools/libxc/xc_sr_save.c @@ -473,7 +473,7 @@ static int send_memory_live(struct xc_sr_context *ctx) xc_shadow_op_stats_t stats = { 0, ctx->save.p2m_size }; char *progress_str = NULL; unsigned x; - int rc = -1; + int rc; rc = update_progress_string(ctx, &progress_str, 0); if ( rc ) @@ -525,7 +525,7 @@ static int suspend_and_send_dirty(struct xc_sr_context *ctx) xc_interface *xch = ctx->xch; xc_shadow_op_stats_t stats = { 0, ctx->save.p2m_size }; char *progress_str = NULL; - int rc = -1; + int rc; DECLARE_HYPERCALL_BUFFER_SHADOW(unsigned long, dirty_bitmap, &ctx->save.dirty_bitmap_hbuf); @@ -572,7 +572,7 @@ static int send_memory_verify(struct xc_sr_context *ctx) { xc_interface *xch = ctx->xch; xc_shadow_op_stats_t stats = { 0, ctx->save.p2m_size }; - int rc = -1; + int rc; struct xc_sr_record rec = { .type = REC_TYPE_VERIFY, @@ -612,7 +612,7 @@ static int send_memory_verify(struct xc_sr_context *ctx) */ static int send_domain_memory_live(struct xc_sr_context *ctx) { - int rc = -1; + int rc; rc = enable_logdirty(ctx); if ( rc ) @@ -652,7 +652,7 @@ static int send_domain_memory_checkpointed(struct xc_sr_context *ctx) static int send_domain_memory_nonlive(struct xc_sr_context *ctx) { xc_interface *xch = ctx->xch; - int rc = -1; + int rc; rc = suspend_domain(ctx); if ( rc ) diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c index 94247b7..213bdc2 100644 --- a/tools/libxl/libxl_stream_read.c +++ b/tools/libxl/libxl_stream_read.c @@ -583,7 +583,7 @@ static void write_emulator_blob(libxl__egc *egc, libxl__sr_emulator_hdr *emu_hdr; STATE_AO_GC(stream->ao); char path[256]; - int rc = 0, writefd = -1; + int rc = 0, writefd; if (rec->hdr.length < sizeof(*emu_hdr)) { rc = ERROR_FAIL; -- 1.7.10.4