tty: vt: use printk_once
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Sun, 9 Aug 2009 19:54:03 +0000 (21:54 +0200)
committerLive-CD User <linux@linux.site>
Sat, 19 Sep 2009 20:13:35 +0000 (13:13 -0700)
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/char/tty_ioctl.c
drivers/char/vt.c

index ad6ba4ed280853bce299b8bf6aab4d3d53b7c68e..8e67d5c642a4bbb8fe2abc452c9ab727ecae9d58 100644 (file)
@@ -393,9 +393,7 @@ void tty_termios_encode_baud_rate(struct ktermios *termios,
                termios->c_cflag |= (BOTHER << IBSHIFT);
 #else
        if (ifound == -1 || ofound == -1) {
-               static int warned;
-               if (!warned++)
-                       printk(KERN_WARNING "tty: Unable to return correct "
+               printk_once(KERN_WARNING "tty: Unable to return correct "
                          "speed data as your architecture needs updating.\n");
        }
 #endif
index 5dfbfa7d7606baf4f3f5ee92bd690e7c1b74c4fd..0c80c68cd047400fc4f59a19cb1c0e47826be57c 100644 (file)
@@ -2129,11 +2129,7 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co
        currcons = vc->vc_num;
        if (!vc_cons_allocated(currcons)) {
            /* could this happen? */
-           static int error = 0;
-           if (!error) {
-               error = 1;
-               printk("con_write: tty %d not allocated\n", currcons+1);
-           }
+               printk_once("con_write: tty %d not allocated\n", currcons+1);
            release_console_sem();
            return 0;
        }