* [PATCH v2] serial: sccnxp: Improve verify_port
@ 2013-05-14 15:59 Alexander Shiyan
2013-05-14 16:09 ` Greg Kroah-Hartman
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Shiyan @ 2013-05-14 15:59 UTC (permalink / raw)
To: linux-serial; +Cc: Greg Kroah-Hartman, Jiri Slaby, Alexander Shiyan
The patch improves verify_port procedure by comparing the type of
port and IRQ numbers simultaneously. This can be important in the
case of multiple drivers SCCNXP in the system that are different IRQs.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
drivers/tty/serial/sccnxp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
index c773041..92e6195 100644
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -713,8 +713,8 @@ static void sccnxp_config_port(struct uart_port *port, int flags)
static int sccnxp_verify_port(struct uart_port *port, struct serial_struct *s)
{
- if ((s->type == PORT_UNKNOWN) || (s->type == PORT_SC26XX))
- return 0;
+ if ((s->type != PORT_UNKNOWN) && (s->type != PORT_SC26XX))
+ return -EINVAL;
if (s->irq == port->irq)
return 0;
--
1.8.1.5
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v2] serial: sccnxp: Improve verify_port
2013-05-14 15:59 [PATCH v2] serial: sccnxp: Improve verify_port Alexander Shiyan
@ 2013-05-14 16:09 ` Greg Kroah-Hartman
2013-05-14 16:30 ` Re[2]: " Alexander Shiyan
0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2013-05-14 16:09 UTC (permalink / raw)
To: Alexander Shiyan; +Cc: linux-serial, Jiri Slaby
On Tue, May 14, 2013 at 07:59:11PM +0400, Alexander Shiyan wrote:
> The patch improves verify_port procedure by comparing the type of
> port and IRQ numbers simultaneously. This can be important in the
> case of multiple drivers SCCNXP in the system that are different IRQs.
So this fixes a bug? Really?
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
> drivers/tty/serial/sccnxp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
> index c773041..92e6195 100644
> --- a/drivers/tty/serial/sccnxp.c
> +++ b/drivers/tty/serial/sccnxp.c
> @@ -713,8 +713,8 @@ static void sccnxp_config_port(struct uart_port *port, int flags)
>
> static int sccnxp_verify_port(struct uart_port *port, struct serial_struct *s)
> {
> - if ((s->type == PORT_UNKNOWN) || (s->type == PORT_SC26XX))
> - return 0;
> + if ((s->type != PORT_UNKNOWN) && (s->type != PORT_SC26XX))
> + return -EINVAL;
Why are you now returning a different value?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread* Re[2]: [PATCH v2] serial: sccnxp: Improve verify_port
2013-05-14 16:09 ` Greg Kroah-Hartman
@ 2013-05-14 16:30 ` Alexander Shiyan
2013-05-14 16:46 ` Greg Kroah-Hartman
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Shiyan @ 2013-05-14 16:30 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-serial, Jiri Slaby
> On Tue, May 14, 2013 at 07:59:11PM +0400, Alexander Shiyan wrote:
> > The patch improves verify_port procedure by comparing the type of
> > port and IRQ numbers simultaneously. This can be important in the
> > case of multiple drivers SCCNXP in the system that are different IRQs.
>
> So this fixes a bug? Really?
Only in theory.
> > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> > ---
> > drivers/tty/serial/sccnxp.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
> > index c773041..92e6195 100644
> > --- a/drivers/tty/serial/sccnxp.c
> > +++ b/drivers/tty/serial/sccnxp.c
> > @@ -713,8 +713,8 @@ static void sccnxp_config_port(struct uart_port *port, int flags)
> >
> > static int sccnxp_verify_port(struct uart_port *port, struct serial_struct *s)
> > {
> > - if ((s->type == PORT_UNKNOWN) || (s->type == PORT_SC26XX))
> > - return 0;
> > + if ((s->type != PORT_UNKNOWN) && (s->type != PORT_SC26XX))
> > + return -EINVAL;
>
> Why are you now returning a different value?
Value is not different. Patch just change logic a bit. Zero on success,
same as before.
---
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2] serial: sccnxp: Improve verify_port
2013-05-14 16:30 ` Re[2]: " Alexander Shiyan
@ 2013-05-14 16:46 ` Greg Kroah-Hartman
2013-05-14 16:58 ` Re[2]: " Alexander Shiyan
0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2013-05-14 16:46 UTC (permalink / raw)
To: Alexander Shiyan; +Cc: linux-serial, Jiri Slaby
On Tue, May 14, 2013 at 08:30:47PM +0400, Alexander Shiyan wrote:
> > On Tue, May 14, 2013 at 07:59:11PM +0400, Alexander Shiyan wrote:
> > > The patch improves verify_port procedure by comparing the type of
> > > port and IRQ numbers simultaneously. This can be important in the
> > > case of multiple drivers SCCNXP in the system that are different IRQs.
> >
> > So this fixes a bug? Really?
>
> Only in theory.
How? It really doesn't look like you are doing anything here, except
rearranging the logic to look different, but yet do the same thing.
So again, why are you doing this?
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re[2]: [PATCH v2] serial: sccnxp: Improve verify_port
2013-05-14 16:46 ` Greg Kroah-Hartman
@ 2013-05-14 16:58 ` Alexander Shiyan
0 siblings, 0 replies; 5+ messages in thread
From: Alexander Shiyan @ 2013-05-14 16:58 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-serial, Jiri Slaby
> > > On Tue, May 14, 2013 at 07:59:11PM +0400, Alexander Shiyan wrote:
> > > > The patch improves verify_port procedure by comparing the type of
> > > > port and IRQ numbers simultaneously. This can be important in the
> > > > case of multiple drivers SCCNXP in the system that are different IRQs.
> > >
> > > So this fixes a bug? Really?
> >
> > Only in theory.
>
> How? It really doesn't look like you are doing anything here, except
> rearranging the logic to look different, but yet do the same thing.
Procedure do not compare IRQ before if port type is valid.
> So again, why are you doing this?
Well, just drop this patch. I cannot say more than now.
---
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-05-14 16:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-14 15:59 [PATCH v2] serial: sccnxp: Improve verify_port Alexander Shiyan
2013-05-14 16:09 ` Greg Kroah-Hartman
2013-05-14 16:30 ` Re[2]: " Alexander Shiyan
2013-05-14 16:46 ` Greg Kroah-Hartman
2013-05-14 16:58 ` Re[2]: " Alexander Shiyan
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).