staging: speakup: fixed checkpatch and sparse warnings in selection.c
Signed-off-by: Chris Yungmann <yungmann.chris@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a2c49a9ac9
commit
e888fabd10
@ -68,7 +68,7 @@ int speakup_set_selection(struct tty_struct *tty)
|
|||||||
if (spk_sel_cons != vc_cons[fg_console].d) {
|
if (spk_sel_cons != vc_cons[fg_console].d) {
|
||||||
speakup_clear_selection();
|
speakup_clear_selection();
|
||||||
spk_sel_cons = vc_cons[fg_console].d;
|
spk_sel_cons = vc_cons[fg_console].d;
|
||||||
printk(KERN_WARNING
|
dev_warn(tty->dev,
|
||||||
"Selection: mark console not the same as cut\n");
|
"Selection: mark console not the same as cut\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ int speakup_set_selection(struct tty_struct *tty)
|
|||||||
/* Allocate a new buffer before freeing the old one ... */
|
/* Allocate a new buffer before freeing the old one ... */
|
||||||
bp = kmalloc((sel_end-sel_start)/2+1, GFP_ATOMIC);
|
bp = kmalloc((sel_end-sel_start)/2+1, GFP_ATOMIC);
|
||||||
if (!bp) {
|
if (!bp) {
|
||||||
printk(KERN_WARNING "selection: kmalloc() failed\n");
|
dev_warn(tty->dev, "selection: kmalloc() failed\n");
|
||||||
speakup_clear_selection();
|
speakup_clear_selection();
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
@ -141,7 +141,7 @@ int speakup_paste_selection(struct tty_struct *tty)
|
|||||||
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);
|
||||||
tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted,
|
tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted,
|
||||||
0, count);
|
NULL, count);
|
||||||
pasted += count;
|
pasted += count;
|
||||||
}
|
}
|
||||||
remove_wait_queue(&vc->paste_wait, &wait);
|
remove_wait_queue(&vc->paste_wait, &wait);
|
||||||
|
Loading…
Reference in New Issue
Block a user