[RFA,01/13] Simple unused variable removals

Message ID eea7c4a9-b3b5-2321-4ded-055ef2f6d521@simark.ca
State New, archived
Headers

Commit Message

Simon Marchi July 14, 2018, 9:55 p.m. UTC
  On 2018-07-14 08:40 AM, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
> 
> Simon> -      CORE_ADDR size = extract_unsigned_integer (ovly_table + 16*i + 4,
> Simon> -						 4, byte_order);
> 
> Simon> I wondered this was a bug (should that variable really be used), but I
> Simon> wouldn't know without some quite extensive research...  so all-in-all, LGTM.
> 
> Yes, this one was on the bubble and I almost put it in its own patch...
> I can't recall offhand if there were others like this.
> 
> Tom
> 


And here's another one that I think is less obvious.  The call has side-effects
(it allocates the per-inferior data), but I don't think it's really needed.


From 4014eefe405a66c6e2ade325e14ed891e9f0f62a Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@polymtl.ca>
Date: Fri, 13 Jul 2018 23:09:04 -0400
Subject: [PATCH] semi-obvious

---
 gdb/remote-sim.c | 6 ------
 1 file changed, 6 deletions(-)
  

Comments

Pedro Alves July 16, 2018, 1:38 p.m. UTC | #1
On 07/14/2018 10:55 PM, Simon Marchi wrote:

> And here's another one that I think is less obvious.  The call has side-effects
> (it allocates the per-inferior data), but I don't think it's really needed.

I'm pretty sure it's not needed.  Feel free to push in,
I don't think there's need to squash with Tromey's patch.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index cc7a6f27fc99..d30b38ecb7ce 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -831,9 +831,6 @@  gdbsim_close_inferior (struct inferior *inf, void *arg)
 void
 gdbsim_target::close ()
 {
-  struct sim_inferior_data *sim_data
-    = get_sim_inferior_data (current_inferior (), SIM_INSTANCE_NOT_NEEDED);
-
   if (remote_debug)
     fprintf_unfiltered (gdb_stdlog, "gdbsim_close\n");

@@ -1184,9 +1181,6 @@  gdbsim_target::files_info ()
 void
 gdbsim_target::mourn_inferior ()
 {
-  struct sim_inferior_data *sim_data
-    = get_sim_inferior_data (current_inferior (), SIM_INSTANCE_NOT_NEEDED);
-
   if (remote_debug)
     fprintf_unfiltered (gdb_stdlog, "gdbsim_mourn_inferior:\n");