Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Remove dead serial_interface_lookup calls
Date: Thu, 12 Jan 2017 15:42:00 -0000	[thread overview]
Message-ID: <7cc9646e-c100-3f4c-1042-682ff3b5e90d@ericsson.com> (raw)
In-Reply-To: <20170112083228.GM9518@E107787-LIN>

On 17-01-12 03:32 AM, Yao Qi wrote:
> 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.

Right, thanks for digging those out.

>>
>>  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 */
> 

Thanks, I updated the commit message with references to those commits and pushed it:


From 0e88921b1628d0c54b1bcba7abb2c354d39664db Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@ericsson.com>
Date: Thu, 12 Jan 2017 10:39:35 -0500
Subject: [PATCH] Remove dead serial_interface_lookup calls

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.  The commits that removed the "pc" and "parallel"
 interfaces are respectively:

  cb2a4ac5dae478fcd9d6e772530c3aba0576fc7a

and

  e386d4d2fb55042f77d0557a0849ed2464aee7b3

gdb/ChangeLog:

	* serial.c (serial_open): Forget about "pc" and "lpt" serial interface.
---
 gdb/ChangeLog | 4 ++++
 gdb/serial.c  | 6 +-----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 89bbb8fbaf..153f6cd7df 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2017-01-12  Simon Marchi  <simon.marchi@ericsson.com>
+
+	* serial.c (serial_open): Forget about "pc" and "lpt" serial interface.
+
 2017-01-11  Simon Marchi  <simon.marchi@ericsson.com>

 	* cli/cli-decode.c (lookup_cmd_1): Fix typo in comment.
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.  */
-- 
2.11.0




      reply	other threads:[~2017-01-12 15:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-11 15:59 Simon Marchi
2017-01-12  8:32 ` Yao Qi
2017-01-12 15:42   ` Simon Marchi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7cc9646e-c100-3f4c-1042-682ff3b5e90d@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox