From 496124e5e16e4974c71404bc9ddaa016156f8cb0 Mon Sep 17 00:00:00 2001 From: Okash Khawaja Date: Wed, 17 Apr 2019 13:21:13 +0100 Subject: vt: selection: allow functions to be called from inside kernel This patch breaks set_selection() into two functions so that when called from kernel, copy_from_user() can be avoided. The two functions are called set_selection_user() and set_selection_kernel() in order to be explicit about their purposes. This also means updating any references to set_selection() and fixing for name change. It also exports set_selection_kernel() and paste_selection(). These changes are used the following patch where speakup's selection functionality calls into the above functions, thereby doing away with parallel implementation. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault Tested-by: Gregory Nowak Signed-off-by: Greg Kroah-Hartman --- include/linux/selection.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include/linux') diff --git a/include/linux/selection.h b/include/linux/selection.h index a8f5b97b216f..e2c1f96bf059 100644 --- a/include/linux/selection.h +++ b/include/linux/selection.h @@ -11,13 +11,14 @@ #include #include -struct tty_struct; - extern struct vc_data *sel_cons; struct tty_struct; extern void clear_selection(void); -extern int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty); +extern int set_selection_user(const struct tiocl_selection __user *sel, + struct tty_struct *tty); +extern int set_selection_kernel(struct tiocl_selection *v, + struct tty_struct *tty); extern int paste_selection(struct tty_struct *tty); extern int sel_loadlut(char __user *p); extern int mouse_reporting(void); -- cgit v1.2.3-71-gd317