diff options
author | Jeff Dike <jdike@addtoit.com> | 2008-02-05 01:30:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-05 12:44:25 -0500 |
commit | acb2cf34cf624b9b3ab20c2c83543146128a4dad (patch) | |
tree | 51ab61c256a8da273c5f7ede4a7512867fd5261f | |
parent | 054211acad0cb911177507a039d8e7a25bff084d (diff) |
uml: console driver cleanups
Console driver cleanups -
Changed an instance of foo = bar + foo to foo += bar
Removed checks of tty->stopped - I don't think the low-level
driver has any business looking at that
Removed an annoying warning
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/um/drivers/line.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 83bf15a3dda8..5cff6536a843 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c | |||
@@ -48,7 +48,7 @@ static int write_room(struct line *line) | |||
48 | n = line->head - line->tail; | 48 | n = line->head - line->tail; |
49 | 49 | ||
50 | if (n <= 0) | 50 | if (n <= 0) |
51 | n = LINE_BUFSIZE + n; /* The other case */ | 51 | n += LINE_BUFSIZE; /* The other case */ |
52 | return n - 1; | 52 | return n - 1; |
53 | } | 53 | } |
54 | 54 | ||
@@ -58,17 +58,10 @@ int line_write_room(struct tty_struct *tty) | |||
58 | unsigned long flags; | 58 | unsigned long flags; |
59 | int room; | 59 | int room; |
60 | 60 | ||
61 | if (tty->stopped) | ||
62 | return 0; | ||
63 | |||
64 | spin_lock_irqsave(&line->lock, flags); | 61 | spin_lock_irqsave(&line->lock, flags); |
65 | room = write_room(line); | 62 | room = write_room(line); |
66 | spin_unlock_irqrestore(&line->lock, flags); | 63 | spin_unlock_irqrestore(&line->lock, flags); |
67 | 64 | ||
68 | /*XXX: Warning to remove */ | ||
69 | if (0 == room) | ||
70 | printk(KERN_DEBUG "%s: %s: no room left in buffer\n", | ||
71 | __FUNCTION__,tty->name); | ||
72 | return room; | 65 | return room; |
73 | } | 66 | } |
74 | 67 | ||
@@ -79,8 +72,7 @@ int line_chars_in_buffer(struct tty_struct *tty) | |||
79 | int ret; | 72 | int ret; |
80 | 73 | ||
81 | spin_lock_irqsave(&line->lock, flags); | 74 | spin_lock_irqsave(&line->lock, flags); |
82 | 75 | /* write_room subtracts 1 for the needed NULL, so we readd it.*/ | |
83 | /*write_room subtracts 1 for the needed NULL, so we readd it.*/ | ||
84 | ret = LINE_BUFSIZE - (write_room(line) + 1); | 76 | ret = LINE_BUFSIZE - (write_room(line) + 1); |
85 | spin_unlock_irqrestore(&line->lock, flags); | 77 | spin_unlock_irqrestore(&line->lock, flags); |
86 | 78 | ||
@@ -184,10 +176,6 @@ void line_flush_buffer(struct tty_struct *tty) | |||
184 | unsigned long flags; | 176 | unsigned long flags; |
185 | int err; | 177 | int err; |
186 | 178 | ||
187 | /*XXX: copied from line_write, verify if it is correct!*/ | ||
188 | if (tty->stopped) | ||
189 | return; | ||
190 | |||
191 | spin_lock_irqsave(&line->lock, flags); | 179 | spin_lock_irqsave(&line->lock, flags); |
192 | err = flush_buffer(line); | 180 | err = flush_buffer(line); |
193 | spin_unlock_irqrestore(&line->lock, flags); | 181 | spin_unlock_irqrestore(&line->lock, flags); |
@@ -213,9 +201,6 @@ int line_write(struct tty_struct *tty, const unsigned char *buf, int len) | |||
213 | unsigned long flags; | 201 | unsigned long flags; |
214 | int n, ret = 0; | 202 | int n, ret = 0; |
215 | 203 | ||
216 | if (tty->stopped) | ||
217 | return 0; | ||
218 | |||
219 | spin_lock_irqsave(&line->lock, flags); | 204 | spin_lock_irqsave(&line->lock, flags); |
220 | if (line->head != line->tail) | 205 | if (line->head != line->tail) |
221 | ret = buffer_data(line, buf, len); | 206 | ret = buffer_data(line, buf, len); |