summaryrefslogtreecommitdiff
path: root/include/linux/console_struct.h
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2020-06-15 09:48:38 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-24 17:08:31 +0200
commitdbee4cffa1bfe23263edde1d17cdbef0de3a6ac0 (patch)
tree53ce9562db27e72303ee55f2c6c279564c4902f5 /include/linux/console_struct.h
parentb70ec4d97f4cc4f6f804ca57419d070b80a9874e (diff)
vt: convert vc_tab_stop to bitmap
vc_tab_stop is used as a bitmap, but defined as an unsigned int array. Switch it to bitmap and convert all users to the bitmap interface. Note the difference in behavior! We no longer mask the top 24 bits away from x, hence we do not wrap tabs at 256th column. Instead, we silently drop attempts to set a tab behind 256 columns. And we will also seek by '\t' to the rightmost column, when behind that boundary. I do not think the original behavior was desired and that someone relies on that. If this turns out to be the case, we can change the added 'if's back to masks here and there instead... (Or we can increase the limit as fb consoles now have 240 chars here. And they could have more with higher than my resolution, of course.) Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200615074910.19267-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/console_struct.h')
-rw-r--r--include/linux/console_struct.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index 623e86689c3a..81f7afcd061a 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -21,6 +21,7 @@ struct uni_pagedir;
struct uni_screen;
#define NPAR 16
+#define VC_TABSTOPS_COUNT 256U
enum vc_intensity {
VCI_HALF_BRIGHT,
@@ -147,7 +148,7 @@ struct vc_data {
unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */
unsigned char vc_utf_count;
int vc_utf_char;
- unsigned int vc_tab_stop[8]; /* Tab stops. 256 columns. */
+ DECLARE_BITMAP(vc_tab_stop, VC_TABSTOPS_COUNT); /* Tab stops. 256 columns. */
unsigned char vc_palette[16*3]; /* Colour palette for VGA+ */
unsigned short * vc_translate;
unsigned int vc_resize_user; /* resize request from user */