Merge branch 'irqclean-submit1' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzi...
[pandora-kernel.git] / arch / um / drivers / chan_kern.c
index cd13b91..3576b3c 100644 (file)
@@ -110,7 +110,7 @@ static void not_configged_free(void *data)
               "UML\n");
 }
 
-static struct chan_ops not_configged_ops = {
+static const struct chan_ops not_configged_ops = {
        .init           = not_configged_init,
        .open           = not_configged_open,
        .close          = not_configged_close,
@@ -186,9 +186,6 @@ static void tty_receive_char(struct tty_struct *tty, char ch)
                }
        }
 
-       if((tty->flip.flag_buf_ptr == NULL) ||
-          (tty->flip.char_buf_ptr == NULL))
-               return;
        tty_insert_flip_char(tty, ch, TTY_NORMAL);
 }
 
@@ -376,7 +373,7 @@ int console_write_chan(struct list_head *chans, const char *buf, int len)
 }
 
 int console_open_chan(struct line *line, struct console *co,
-                     struct chan_opts *opts)
+                     const struct chan_opts *opts)
 {
        int err;
 
@@ -406,7 +403,7 @@ int chan_window_size(struct list_head *chans, unsigned short *rows_out,
        return 0;
 }
 
-void free_one_chan(struct chan *chan, int delay_free_irq)
+static void free_one_chan(struct chan *chan, int delay_free_irq)
 {
        list_del(&chan->list);
 
@@ -419,7 +416,7 @@ void free_one_chan(struct chan *chan, int delay_free_irq)
        kfree(chan);
 }
 
-void free_chan(struct list_head *chans, int delay_free_irq)
+static void free_chan(struct list_head *chans, int delay_free_irq)
 {
        struct list_head *ele, *next;
        struct chan *chan;
@@ -497,10 +494,10 @@ int chan_config_string(struct list_head *chans, char *str, int size,
 
 struct chan_type {
        char *key;
-       struct chan_ops *ops;
+       const struct chan_ops *ops;
 };
 
-struct chan_type chan_table[] = {
+static const struct chan_type chan_table[] = {
        { "fd", &fd_ops },
 
 #ifdef CONFIG_NULL_CHAN
@@ -537,17 +534,17 @@ struct chan_type chan_table[] = {
 };
 
 static struct chan *parse_chan(struct line *line, char *str, int device,
-                              struct chan_opts *opts)
+                              const struct chan_opts *opts)
 {
-       struct chan_type *entry;
-       struct chan_ops *ops;
+       const struct chan_type *entry;
+       const struct chan_ops *ops;
        struct chan *chan;
        void *data;
        int i;
 
        ops = NULL;
        data = NULL;
-       for(i = 0; i < sizeof(chan_table)/sizeof(chan_table[0]); i++){
+       for(i = 0; i < ARRAY_SIZE(chan_table); i++){
                entry = &chan_table[i];
                if(!strncmp(str, entry->key, strlen(entry->key))){
                        ops = entry->ops;
@@ -585,7 +582,7 @@ static struct chan *parse_chan(struct line *line, char *str, int device,
 }
 
 int parse_chan_pair(char *str, struct line *line, int device,
-                   struct chan_opts *opts)
+                   const struct chan_opts *opts)
 {
        struct list_head *chans = &line->chan_list;
        struct chan *new, *chan;
@@ -653,8 +650,7 @@ void chan_interrupt(struct list_head *chans, struct work_struct *task,
                chan = list_entry(ele, struct chan, list);
                if(!chan->input || (chan->ops->read == NULL)) continue;
                do {
-                       if((tty != NULL) &&
-                          (tty->flip.count >= TTY_FLIPBUF_SIZE)){
+                       if (tty && !tty_buffer_request_room(tty, 1)) {
                                schedule_delayed_work(task, 1);
                                goto out;
                        }