diff options
author | Jiri Slaby <jslaby@suse.cz> | 2020-02-19 10:39:43 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-02-21 12:31:18 +0300 |
commit | dce05aa6eec977f1472abed95ccd71276b9a3864 (patch) | |
tree | 8b48ff19cf4255022f7454b74dd900206ca99691 /drivers/tty/vt/selection.c | |
parent | 80967ff2d15fb91f5046118d1de3ef32a151e30a (diff) | |
download | linux-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.c | 5 |
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. |