fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / alpha / kernel / srmcons.c
index b5660fc..7569232 100644 (file)
@@ -5,7 +5,6 @@
  * (TTY driver and console driver)
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/console.h>
@@ -164,29 +163,22 @@ srmcons_get_private_struct(struct srmcons_private **ps)
        unsigned long flags;
        int retval = 0;
 
-       spin_lock_irqsave(&srmconsp_lock, flags);
-
-       do {
-               if (srmconsp != NULL) {
-                       *ps = srmconsp;
-                       break;
-               }
+       if (srmconsp == NULL) {
+               spin_lock_irqsave(&srmconsp_lock, flags);
 
                srmconsp = kmalloc(sizeof(*srmconsp), GFP_KERNEL);
-               if (srmconsp == NULL) {
+               if (srmconsp == NULL)
                        retval = -ENOMEM;
-                       break;
+               else {
+                       srmconsp->tty = NULL;
+                       spin_lock_init(&srmconsp->lock);
+                       init_timer(&srmconsp->timer);
                }
 
-               srmconsp->tty = NULL;
-               spin_lock_init(&srmconsp->lock);
-               init_timer(&srmconsp->timer);
-
-               *ps = srmconsp;
-       } while(0);
-
-       spin_unlock_irqrestore(&srmconsp_lock, flags);
+               spin_unlock_irqrestore(&srmconsp_lock, flags);
+       }
 
+       *ps = srmconsp;
        return retval;
 }
 
@@ -237,7 +229,7 @@ srmcons_close(struct tty_struct *tty, struct file *filp)
 
 static struct tty_driver *srmcons_driver;
 
-static struct tty_operations srmcons_ops = {
+static const struct tty_operations srmcons_ops = {
        .open           = srmcons_open,
        .close          = srmcons_close,
        .write          = srmcons_write,