linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: fix port type conflict between NS16550A & U6_16550A
@ 2010-08-31 12:19 Philippe Langlais
  2010-08-31 13:29 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Langlais @ 2010-08-31 12:19 UTC (permalink / raw)
  To: gregkh, linux-serial
  Cc: linux, STEricsson_nomadik_linux, loic.pallardy, vincent.guittot,
	Philippe Langlais

Bug seen by Dr. David Alan Gilbert with sparse

Signed-off-by: Philippe Langlais <philippe.langlais@stericsson.com>
---
 include/linux/serial.h      |    3 +--
 include/linux/serial_core.h |    3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/serial.h b/include/linux/serial.h
index 06c99b6..c8613c3 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -77,8 +77,7 @@ struct serial_struct {
 #define PORT_16654	11
 #define PORT_16850	12
 #define PORT_RSA	13	/* RSA-DV II/S card */
-#define PORT_U6_16550A	14
-#define PORT_MAX	14
+#define PORT_MAX	13
 
 #define SERIAL_IO_PORT	0
 #define SERIAL_IO_HUB6	1
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 119354f..6513f27 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -44,7 +44,8 @@
 #define PORT_RM9000	16	/* PMC-Sierra RM9xxx internal UART */
 #define PORT_OCTEON	17	/* Cavium OCTEON internal UART */
 #define PORT_AR7	18	/* Texas Instruments AR7 internal UART */
-#define PORT_MAX_8250	18	/* max port ID */
+#define PORT_U6_16550A	19	/* ST-Ericsson U6xxx internal UART */
+#define PORT_MAX_8250	19	/* max port ID */
 
 /*
  * ARM specific type numbers.  These are not currently guaranteed
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] serial: fix port type conflict between NS16550A & U6_16550A
  2010-08-31 12:19 [PATCH] serial: fix port type conflict between NS16550A & U6_16550A Philippe Langlais
@ 2010-08-31 13:29 ` Greg KH
  2010-08-31 18:11   ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2010-08-31 13:29 UTC (permalink / raw)
  To: Philippe Langlais
  Cc: linux-serial, linux, STEricsson_nomadik_linux, loic.pallardy,
	vincent.guittot

On Tue, Aug 31, 2010 at 02:19:09PM +0200, Philippe Langlais wrote:
> Bug seen by Dr. David Alan Gilbert with sparse

sparse found this?  nice.

But odds are we should switch this to an enum to try to find it earlier,
right?

I'll go queue this up.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] serial: fix port type conflict between NS16550A & U6_16550A
  2010-08-31 13:29 ` Greg KH
@ 2010-08-31 18:11   ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 3+ messages in thread
From: Dr. David Alan Gilbert @ 2010-08-31 18:11 UTC (permalink / raw)
  To: Greg KH
  Cc: Philippe Langlais, linux-serial, STEricsson_nomadik_linux,
	loic.pallardy, vincent.guittot

* Greg KH (gregkh@suse.de) wrote:
> On Tue, Aug 31, 2010 at 02:19:09PM +0200, Philippe Langlais wrote:
> > Bug seen by Dr. David Alan Gilbert with sparse
> 
> sparse found this?  nice.

It spotted it because it ended up causing the same element of the array
to be initialised twice.
A few hours spent playing with sparse has spotted some nice easy-to-fix
thinko type bugs (this one, two parameters being swapped to kzalloc,
a few places where people passed enums in place of bools).   Basically
if you ignore all the address space, static and locking output
whats left is 'odd' stuff that appears to be worthy of a read.
(That's from my first time using it).  They're all the class of problems
that you would hope a type system in the compiler would spot.

> But odds are we should switch this to an enum to try to find it earlier,
> right?

An enum would be nice; but the other problem is that there are two
lists one in serial.h and one in serial_core.h that both start
in the same way - it was just a matter of time until something
got added to the wrong one. IMO the older list needs killing
unless there is a very good reason for it.

Dave
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\ gro.gilbert @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-31 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-31 12:19 [PATCH] serial: fix port type conflict between NS16550A & U6_16550A Philippe Langlais
2010-08-31 13:29 ` Greg KH
2010-08-31 18:11   ` Dr. David Alan Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).