Remove dead serial_interface_lookup calls

Message ID 20170111155847.13244-1-simon.marchi@ericsson.com
State New, archived
Headers

Commit Message

Simon Marchi Jan. 11, 2017, 3:58 p.m. UTC
  By inspecting the serial_add_interface calls, I found that the serial
interface names that we have today are:

 - hardwire
 - terminal
 - pipe
 - tcp
 - event

 The calls to serial_interface_lookup with any other names are most
 likely leftovers which can be removed since these serial interfaces
 don't exist anymore.  If you go back to the commits that added the
 lines this patch removes, you'll find the serial interface that existed
 at that time.

 gdb/ChangeLog:

	* serial.c (serial_open): Forget about "pc" and "lpt" serial interface.
---
 gdb/serial.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
  

Comments

Yao Qi Jan. 12, 2017, 8:32 a.m. UTC | #1
On 17-01-11 10:58:47, Simon Marchi wrote:
> By inspecting the serial_add_interface calls, I found that the serial
> interface names that we have today are:
> 
>  - hardwire
>  - terminal
>  - pipe
>  - tcp
>  - event
> 
>  The calls to serial_interface_lookup with any other names are most
>  likely leftovers which can be removed since these serial interfaces
>  don't exist anymore.  If you go back to the commits that added the
>  lines this patch removes, you'll find the serial interface that existed
>  at that time.

It would be nice to show the commits remove these serial interfaces.

> 
>  gdb/ChangeLog:
> 
> 	* serial.c (serial_open): Forget about "pc" and "lpt" serial interface.

Patch is good to me.

> ---
>  gdb/serial.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/gdb/serial.c b/gdb/serial.c
> index ac7c1b99c1..afb70758c6 100644
> --- a/gdb/serial.c
> +++ b/gdb/serial.c
> @@ -209,11 +209,7 @@ serial_open (const char *name)
>    const struct serial_ops *ops;
>    const char *open_name = name;
>  
> -  if (strcmp (name, "pc") == 0)
> -    ops = serial_interface_lookup ("pc");

It was removed by cb2a4ac5dae478fcd9d6e772530c3aba0576fc7a

-static struct serial_ops e7000pc_ops =
-{
-  "pc",
-  0,
-  e7000pc_open,
-  e7000pc_close,
-  e7000pc_readchar,
-  e7000pc_write,
-  e7000pc_noop,                        /* flush output */

> -  else if (startswith (name, "lpt"))
> -    ops = serial_interface_lookup ("parallel");

It was removed by e386d4d2fb55042f77d0557a0849ed2464aee7b3

-static struct serial_ops go32_ops =
-{
-  "parallel",
-  0,
-  go32_open,
-  go32_close,
-  go32_readchar,
-  go32_write,
-  go32_noop,			/* flush output */
  

Patch

diff --git a/gdb/serial.c b/gdb/serial.c
index ac7c1b99c1..afb70758c6 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -209,11 +209,7 @@  serial_open (const char *name)
   const struct serial_ops *ops;
   const char *open_name = name;
 
-  if (strcmp (name, "pc") == 0)
-    ops = serial_interface_lookup ("pc");
-  else if (startswith (name, "lpt"))
-    ops = serial_interface_lookup ("parallel");
-  else if (startswith (name, "|"))
+  if (startswith (name, "|"))
     {
       ops = serial_interface_lookup ("pipe");
       /* Discard ``|'' and any space before the command itself.  */