Commit a1768fbb authored by William Hubbs's avatar William Hubbs Committed by Greg Kroah-Hartman

staging: speakup: selection.c style fixes

fix issues reported by checkpatch.pl
Signed-off-by: default avatarWilliam Hubbs <w.d.hubbs@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 16d35515
...@@ -23,7 +23,8 @@ static char *sel_buffer; ...@@ -23,7 +23,8 @@ static char *sel_buffer;
static unsigned char sel_pos(int n) static unsigned char sel_pos(int n)
{ {
return inverse_translate(spk_sel_cons, screen_glyph(spk_sel_cons, n), 0); return inverse_translate(spk_sel_cons,
screen_glyph(spk_sel_cons, n), 0);
} }
void speakup_clear_selection(void) void speakup_clear_selection(void)
...@@ -34,7 +35,7 @@ void speakup_clear_selection(void) ...@@ -34,7 +35,7 @@ void speakup_clear_selection(void)
/* does screen address p correspond to character at LH/RH edge of screen? */ /* does screen address p correspond to character at LH/RH edge of screen? */
static int atedge(const int p, int size_row) static int atedge(const int p, int size_row)
{ {
return (!(p % size_row) || !((p + 2) % size_row)); return !(p % size_row) || !((p + 2) % size_row);
} }
/* constrain v such that v <= u */ /* constrain v such that v <= u */
...@@ -132,20 +133,15 @@ int speakup_paste_selection(struct tty_struct *tty) ...@@ -132,20 +133,15 @@ int speakup_paste_selection(struct tty_struct *tty)
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
if (test_bit(TTY_THROTTLED, &tty->flags)) { if (test_bit(TTY_THROTTLED, &tty->flags)) {
if (in_atomic()) if (in_atomic())
/* can't be performed in an interrupt handler, abort */ /* if we are in an interrupt handler, abort */
break; break;
schedule(); schedule();
continue; continue;
} }
count = sel_buffer_lth - pasted; count = sel_buffer_lth - pasted;
count = min_t(int, count, tty->receive_room); count = min_t(int, count, tty->receive_room);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted,
tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted, 0, count); 0, count);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
tty->ldisc.ops->receive_buf(tty, sel_buffer + pasted, 0, count);
#else
tty->ldisc.receive_buf(tty, sel_buffer + pasted, 0, count);
#endif
pasted += count; pasted += count;
} }
remove_wait_queue(&vc->paste_wait, &wait); remove_wait_queue(&vc->paste_wait, &wait);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment