linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] vt: drop an useless enum and assignment.
       [not found] <1391731567-10260-1-git-send-email-kilobyte@angband.pl>
@ 2014-02-13 18:41 ` Greg Kroah-Hartman
  2014-02-16  1:43   ` Adam Borowski
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2014-02-13 18:41 UTC (permalink / raw)
  To: Adam Borowski; +Cc: Jiri Slaby, linux-serial

On Fri, Feb 07, 2014 at 01:06:07AM +0100, Adam Borowski wrote:
> Signed-off-by: Adam Borowski <kilobyte@angband.pl>
> ---
>  drivers/tty/vt/vt.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> index 0377c52..3baed72 100644
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -1588,7 +1588,7 @@ static void restore_cur(struct vc_data *vc)
>  	vc->vc_need_wrap = 0;
>  }
>  
> -enum { ESnormal, ESesc, ESsquare, ESgetpars, ESgotpars, ESfunckey,
> +enum { ESnormal, ESesc, ESsquare, ESgetpars, ESfunckey,
>  	EShash, ESsetG0, ESsetG1, ESpercent, ESignore, ESnonstd,
>  	ESpalette, ESosc };
>  
> @@ -1811,9 +1811,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
>  			vc->vc_par[vc->vc_npar] *= 10;
>  			vc->vc_par[vc->vc_npar] += c - '0';
>  			return;
> -		} else
> -			vc->vc_state = ESgotpars;
> -	case ESgotpars:
> +		}

Yes, this looks odd, but are you sure it's not going to break anything?

And always cc: public mailing lists, kernel development is not done in
private.

thanks,

greg k-h

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

* Re: [PATCH] vt: drop an useless enum and assignment.
  2014-02-13 18:41 ` [PATCH] vt: drop an useless enum and assignment Greg Kroah-Hartman
@ 2014-02-16  1:43   ` Adam Borowski
  2014-02-18 18:45     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Adam Borowski @ 2014-02-16  1:43 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-serial

On Thu, Feb 13, 2014 at 10:41:01AM -0800, Greg Kroah-Hartman wrote:
> On Fri, Feb 07, 2014 at 01:06:07AM +0100, Adam Borowski wrote:
> > Signed-off-by: Adam Borowski <kilobyte@angband.pl>
> > ---
> >  drivers/tty/vt/vt.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> > index 0377c52..3baed72 100644
> > --- a/drivers/tty/vt/vt.c
> > +++ b/drivers/tty/vt/vt.c
> > @@ -1588,7 +1588,7 @@ static void restore_cur(struct vc_data *vc)
> >  	vc->vc_need_wrap = 0;
> >  }
> >  
> > -enum { ESnormal, ESesc, ESsquare, ESgetpars, ESgotpars, ESfunckey,
> > +enum { ESnormal, ESesc, ESsquare, ESgetpars, ESfunckey,
> >  	EShash, ESsetG0, ESsetG1, ESpercent, ESignore, ESnonstd,
> >  	ESpalette, ESosc };
> >  
> > @@ -1811,9 +1811,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
> >  			vc->vc_par[vc->vc_npar] *= 10;
> >  			vc->vc_par[vc->vc_npar] += c - '0';
> >  			return;
> > -		} else
> > -			vc->vc_state = ESgotpars;
> > -	case ESgotpars:
> > +		}
> >             vc->vc_state = ESnormal;
> >             switch(c) {
> >             case 'h':
> 
> Yes, this looks odd, but are you sure it's not going to break anything?

This is a proper enum (ie, no arithmetic is done on it), and the only place
the value of ESgotpars could get assigned is one I removed, which then got
overwritten on the very next statement.

> And always cc: public mailing lists, kernel development is not done in
> private.

Okay.  Posting to -kernel would be spamming just for several bytes of
optimization, and I've read somewhere that -serial is inappropriate for vt
related patches; thanks for clearing this up.

-- 
A tit a day keeps the vet away.

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

* Re: [PATCH] vt: drop an useless enum and assignment.
  2014-02-16  1:43   ` Adam Borowski
@ 2014-02-18 18:45     ` Greg Kroah-Hartman
  2014-02-19  0:40       ` Adam Borowski
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2014-02-18 18:45 UTC (permalink / raw)
  To: Adam Borowski; +Cc: Jiri Slaby, linux-serial

On Sun, Feb 16, 2014 at 02:43:29AM +0100, Adam Borowski wrote:
> On Thu, Feb 13, 2014 at 10:41:01AM -0800, Greg Kroah-Hartman wrote:
> > On Fri, Feb 07, 2014 at 01:06:07AM +0100, Adam Borowski wrote:
> > > Signed-off-by: Adam Borowski <kilobyte@angband.pl>
> > > ---
> > >  drivers/tty/vt/vt.c | 6 ++----
> > >  1 file changed, 2 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> > > index 0377c52..3baed72 100644
> > > --- a/drivers/tty/vt/vt.c
> > > +++ b/drivers/tty/vt/vt.c
> > > @@ -1588,7 +1588,7 @@ static void restore_cur(struct vc_data *vc)
> > >  	vc->vc_need_wrap = 0;
> > >  }
> > >  
> > > -enum { ESnormal, ESesc, ESsquare, ESgetpars, ESgotpars, ESfunckey,
> > > +enum { ESnormal, ESesc, ESsquare, ESgetpars, ESfunckey,
> > >  	EShash, ESsetG0, ESsetG1, ESpercent, ESignore, ESnonstd,
> > >  	ESpalette, ESosc };
> > >  
> > > @@ -1811,9 +1811,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
> > >  			vc->vc_par[vc->vc_npar] *= 10;
> > >  			vc->vc_par[vc->vc_npar] += c - '0';
> > >  			return;
> > > -		} else
> > > -			vc->vc_state = ESgotpars;
> > > -	case ESgotpars:
> > > +		}
> > >             vc->vc_state = ESnormal;
> > >             switch(c) {
> > >             case 'h':
> > 
> > Yes, this looks odd, but are you sure it's not going to break anything?
> 
> This is a proper enum (ie, no arithmetic is done on it), and the only place
> the value of ESgotpars could get assigned is one I removed, which then got
> overwritten on the very next statement.
> 
> > And always cc: public mailing lists, kernel development is not done in
> > private.
> 
> Okay.  Posting to -kernel would be spamming just for several bytes of
> optimization, and I've read somewhere that -serial is inappropriate for vt
> related patches; thanks for clearing this up.

Ok, care to resend along with your other vt patch?

thanks,

greg k-h

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

* [PATCH] vt: drop an useless enum and assignment.
  2014-02-18 18:45     ` Greg Kroah-Hartman
@ 2014-02-19  0:40       ` Adam Borowski
  0 siblings, 0 replies; 4+ messages in thread
From: Adam Borowski @ 2014-02-19  0:40 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, linux-serial; +Cc: Adam Borowski

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
---
 drivers/tty/vt/vt.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 23b5d32..b7bde54 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -1590,7 +1590,7 @@ static void restore_cur(struct vc_data *vc)
 	vc->vc_need_wrap = 0;
 }
 
-enum { ESnormal, ESesc, ESsquare, ESgetpars, ESgotpars, ESfunckey,
+enum { ESnormal, ESesc, ESsquare, ESgetpars, ESfunckey,
 	EShash, ESsetG0, ESsetG1, ESpercent, ESignore, ESnonstd,
 	ESpalette };
 
@@ -1807,9 +1807,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
 			vc->vc_par[vc->vc_npar] *= 10;
 			vc->vc_par[vc->vc_npar] += c - '0';
 			return;
-		} else
-			vc->vc_state = ESgotpars;
-	case ESgotpars:
+		}
 		vc->vc_state = ESnormal;
 		switch(c) {
 		case 'h':
-- 
1.9.0


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

end of thread, other threads:[~2014-02-19  1:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1391731567-10260-1-git-send-email-kilobyte@angband.pl>
2014-02-13 18:41 ` [PATCH] vt: drop an useless enum and assignment Greg Kroah-Hartman
2014-02-16  1:43   ` Adam Borowski
2014-02-18 18:45     ` Greg Kroah-Hartman
2014-02-19  0:40       ` Adam Borowski

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).