[v3] libctf: Remove unused variable initialized to itself

Message ID ee0f1058281360d0a7dc874b13c0c7a8.mforney@mforney.org
State New
Headers
Series [v3] libctf: Remove unused variable initialized to itself |

Commit Message

Michael Forney Sept. 27, 2021, 7:02 p.m. UTC
  2021-10-06  Michael Forney  <mforney@mforney.org>

	* ctf-link.c: Remove unused variable initialized to itself.
---
v2: Remove unused name_ as well.
v3: Rebased on latest master.

This got an ok from Alan Modra four years ago [0], but looks like
it fell through the cracks and never got applied.

[0] https://sourceware.org/pipermail/binutils/2022-March/119925.html

 libctf/ctf-link.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Patch

diff --git a/libctf/ctf-link.c b/libctf/ctf-link.c
index 10bef42602d..9fdd39fdb95 100644
--- a/libctf/ctf-link.c
+++ b/libctf/ctf-link.c
@@ -1649,7 +1649,7 @@  ctf_link_shuffle_syms (ctf_dict_t *fp)
   ctf_in_flight_dynsym_t *did, *nid;
   ctf_next_t *i = NULL;
   int err = ENOMEM;
-  void *name_, *sym_;
+  void *sym_;
 
   if (fp->ctf_stypes > 0)
     return ctf_set_errno (fp, ECTF_RDONLY);
@@ -1733,9 +1733,8 @@  ctf_link_shuffle_syms (ctf_dict_t *fp)
 				   sizeof (ctf_link_sym_t *))) == NULL)
     goto err;
 
-  while ((err = ctf_dynhash_next (fp->ctf_dynsyms, &i, &name_, &sym_)) == 0)
+  while ((err = ctf_dynhash_next (fp->ctf_dynsyms, &i, NULL, &sym_)) == 0)
     {
-      const char *name = (const char *) name;
       ctf_link_sym_t *symp = (ctf_link_sym_t *) sym_;
 
       if (!ctf_assert (fp, symp->st_symidx <= fp->ctf_dynsymmax))