summaryrefslogtreecommitdiff
path: root/drivers/tty/vt/selection.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2020-02-19 10:39:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-21 12:31:18 +0300
commitdce05aa6eec977f1472abed95ccd71276b9a3864 (patch)
tree8b48ff19cf4255022f7454b74dd900206ca99691 /drivers/tty/vt/selection.c
parent80967ff2d15fb91f5046118d1de3ef32a151e30a (diff)
downloadlinux-dce05aa6eec977f1472abed95ccd71276b9a3864.tar.xz
vt: selection, introduce vc_is_sel
Avoid global variables (namely sel_cons) by introducing vc_is_sel. It checks whether the parameter is the current selection console. This will help putting sel_cons to a struct later. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219073951.16151-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt/selection.c')
-rw-r--r--drivers/tty/vt/selection.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/tty/vt/selection.c b/drivers/tty/vt/selection.c
index 78732feaf65b..f3ec0037a0e3 100644
--- a/drivers/tty/vt/selection.c
+++ b/drivers/tty/vt/selection.c
@@ -84,6 +84,11 @@ void clear_selection(void)
}
EXPORT_SYMBOL_GPL(clear_selection);
+bool vc_is_sel(struct vc_data *vc)
+{
+ return vc == sel_cons;
+}
+
/*
* User settable table: what characters are to be considered alphabetic?
* 128 bits. Locked by the console lock.