[PATCH 2/7] testVirFindSCSIHostByPCI: Remove unused 'path_addr'

Peter Krempa posted 7 patches 5 years, 8 months ago
[PATCH 2/7] testVirFindSCSIHostByPCI: Remove unused 'path_addr'
Posted by Peter Krempa 5 years, 8 months ago
The path is formatted but then just freed without any use.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 tests/scsihosttest.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/tests/scsihosttest.c b/tests/scsihosttest.c
index b58318d295..4b2779eabf 100644
--- a/tests/scsihosttest.c
+++ b/tests/scsihosttest.c
@@ -202,12 +202,9 @@ testVirFindSCSIHostByPCI(const void *data G_GNUC_UNUSED)
     unsigned int unique_id2 = 2;
     const char *pci_addr1 = "0000:00:1f.1";
     const char *pci_addr2 = "0000:00:1f.2";
-    char *path_addr = NULL;
     char *ret_host = NULL;
     int ret = -1;

-    path_addr = g_strdup_printf("%s/%s", abs_srcdir, "sysfs/class/scsi_host");
-
     if (!(ret_host = virSCSIHostFindByPCI(TEST_SCSIHOST_CLASS_PATH,
                                           pci_addr1, unique_id1)) ||
         STRNEQ(ret_host, "host0"))
@@ -236,7 +233,6 @@ testVirFindSCSIHostByPCI(const void *data G_GNUC_UNUSED)

  cleanup:
     VIR_FREE(ret_host);
-    VIR_FREE(path_addr);
     return ret;
 }

-- 
2.26.2

Re: [PATCH 2/7] testVirFindSCSIHostByPCI: Remove unused 'path_addr'
Posted by Ján Tomko 5 years, 8 months ago
On a Thursday in 2020, Peter Krempa wrote:
>The path is formatted but then just freed without any use.
>

Unused since its introduction in ef48a1b613d16b699c175c214c0819d85d4c1801

>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> tests/scsihosttest.c | 4 ----
> 1 file changed, 4 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano