public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: colbuse@ensisun.imag.fr
To: linux-kernel@vger.kernel.org
Cc: akpm@zip.com.au
Subject: [patch 2/2] drivers/chat/vt.c: remove unnecessary code
Date: Mon, 28 Feb 2005 13:55:28 +0100	[thread overview]
Message-ID: <1109595328.422314c031b5f@webmail.imag.fr> (raw)


Avoid changing the state of the console two times in some cases.


Signed-off-by: Emmanuel Colbus <emmanuel.colbus@ensimag.imag.fr>


--- old/drivers/char/vt.c       2004-12-24 22:35:25.000000000 +0100
+++ new/drivers/char/vt.c       2005-02-28 12:56:46.154311486 +0100
@@ -1571,7 +1571,6 @@
        }
        switch(vc_state) {
        case ESesc:
-               vc_state = ESnormal;
                switch (c) {
                case '[':
                        vc_state = ESsquare;
@@ -1585,25 +1584,25 @@
                case 'E':
                        cr(currcons);
                        lf(currcons);
-                       return;
+                       break;
                case 'M':
                        ri(currcons);
-                       return;
+                       break;
                case 'D':
                        lf(currcons);
-                       return;
+                       break;
                case 'H':
                        tab_stop[x >> 5] |= (1 << (x & 31));
-                       return;
+                       break;
                case 'Z':
                        respond_ID(tty);
-                       return;
+                       break;
                case '7':
                        save_cur(currcons);
-                       return;
+                       break;
                case '8':
                        restore_cur(currcons);
-                       return;
+                       break;
                case '(':
                        vc_state = ESsetG0;
                        return;
@@ -1615,14 +1614,15 @@
                        return;
                case 'c':
                        reset_terminal(currcons,1);
-                       return;
+                       break;
                case '>':  /* Numeric keypad */
                        clr_kbd(kbdapplic);
-                       return;
+                       break;
                case '=':  /* Appl. keypad */
                        set_kbd(kbdapplic);
-                       return;
+                       /* Here, we don't need any break; */
                }
+               vc_state = ESnormal;
                return;
        case ESnonstd:
                if (c=='P') {   /* palette escape sequence */



--
Emmanuel Colbus
Club GNU/Linux
ENSIMAG - departement telecoms


-------------------------------------------------
envoyé via Webmail/IMAG !


             reply	other threads:[~2005-02-28 12:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-28 12:55 colbuse [this message]
2005-02-28 14:45 ` [patch 2/2] drivers/chat/vt.c: remove unnecessary code Andries Brouwer
  -- strict thread matches above, loose matches on Subject: below --
2005-02-28 15:16 colbuse

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=1109595328.422314c031b5f@webmail.imag.fr \
    --to=colbuse@ensisun.imag.fr \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    /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