diff options
Diffstat (limited to 'drivers/staging/speakup/selection.c')
-rw-r--r-- | drivers/staging/speakup/selection.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c index 1b865ff00bc..fe1f405d5d7 100644 --- a/drivers/staging/speakup/selection.c +++ b/drivers/staging/speakup/selection.c | |||
@@ -23,7 +23,8 @@ static char *sel_buffer; | |||
23 | 23 | ||
24 | static unsigned char sel_pos(int n) | 24 | static unsigned char sel_pos(int n) |
25 | { | 25 | { |
26 | return inverse_translate(spk_sel_cons, screen_glyph(spk_sel_cons, n), 0); | 26 | return inverse_translate(spk_sel_cons, |
27 | screen_glyph(spk_sel_cons, n), 0); | ||
27 | } | 28 | } |
28 | 29 | ||
29 | void speakup_clear_selection(void) | 30 | void speakup_clear_selection(void) |
@@ -34,7 +35,7 @@ void speakup_clear_selection(void) | |||
34 | /* does screen address p correspond to character at LH/RH edge of screen? */ | 35 | /* does screen address p correspond to character at LH/RH edge of screen? */ |
35 | static int atedge(const int p, int size_row) | 36 | static int atedge(const int p, int size_row) |
36 | { | 37 | { |
37 | return (!(p % size_row) || !((p + 2) % size_row)); | 38 | return !(p % size_row) || !((p + 2) % size_row); |
38 | } | 39 | } |
39 | 40 | ||
40 | /* constrain v such that v <= u */ | 41 | /* constrain v such that v <= u */ |
@@ -132,20 +133,15 @@ int speakup_paste_selection(struct tty_struct *tty) | |||
132 | set_current_state(TASK_INTERRUPTIBLE); | 133 | set_current_state(TASK_INTERRUPTIBLE); |
133 | if (test_bit(TTY_THROTTLED, &tty->flags)) { | 134 | if (test_bit(TTY_THROTTLED, &tty->flags)) { |
134 | if (in_atomic()) | 135 | if (in_atomic()) |
135 | /* can't be performed in an interrupt handler, abort */ | 136 | /* if we are in an interrupt handler, abort */ |
136 | break; | 137 | break; |
137 | schedule(); | 138 | schedule(); |
138 | continue; | 139 | continue; |
139 | } | 140 | } |
140 | count = sel_buffer_lth - pasted; | 141 | count = sel_buffer_lth - pasted; |
141 | count = min_t(int, count, tty->receive_room); | 142 | count = min_t(int, count, tty->receive_room); |
142 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) | 143 | tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted, |
143 | tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted, 0, count); | 144 | 0, count); |
144 | #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) | ||
145 | tty->ldisc.ops->receive_buf(tty, sel_buffer + pasted, 0, count); | ||
146 | #else | ||
147 | tty->ldisc.receive_buf(tty, sel_buffer + pasted, 0, count); | ||
148 | #endif | ||
149 | pasted += count; | 145 | pasted += count; |
150 | } | 146 | } |
151 | remove_wait_queue(&vc->paste_wait, &wait); | 147 | remove_wait_queue(&vc->paste_wait, &wait); |