[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] virStorageBackendIsMultipath: avoid dead store



On 02/11/2010 09:27 AM, Jim Meyering wrote:
This suppresses a warning reported by clang.
Since "target_type" is initialized, there's no point
in storing dm_get_next_target's return value.

From d0cd9b4233194b27fb168e835223dd51e77fa6f2 Mon Sep 17 00:00:00 2001
From: Jim Meyering<meyering redhat com>
Date: Thu, 11 Feb 2010 15:26:37 +0100
Subject: [PATCH] virStorageBackendIsMultipath: avoid dead store

* src/storage/storage_backend_mpath.c (virStorageBackendIsMultipath):
The result of dm_get_next_target was never used (and isn't needed),
so don't store it.
---
  src/storage/storage_backend_mpath.c |    6 ++----
  1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c
index dbcd6d8..1e7504b 100644
--- a/src/storage/storage_backend_mpath.c
+++ b/src/storage/storage_backend_mpath.c
@@ -1,7 +1,7 @@
  /*
   * storage_backend_mpath.c: storage backend for multipath handling
   *
- * Copyright (C) 2009-2009 Red Hat, Inc.
+ * Copyright (C) 2009-2010 Red Hat, Inc.
   * Copyright (C) 2009-2008 Dave Allan
   *
   * This library is free software; you can redistribute it and/or
@@ -150,7 +150,6 @@ virStorageBackendIsMultipath(const char *devname)
  {
      int ret = 0;
      struct dm_task *dmt = NULL;
-    void *next = NULL;
      uint64_t start, length;
      char *target_type = NULL;
      char *params = NULL;
@@ -173,8 +172,7 @@ virStorageBackendIsMultipath(const char *devname)
          goto out;
      }

-    next = dm_get_next_target(dmt, next,&start,&length,
-&target_type,&params);
+    dm_get_next_target(dmt, next,&start,&length,&target_type,&params);

      if (target_type == NULL) {
          ret = -1;
--
1.7.0.rc2.170.gbc565

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

ACK


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]