summaryrefslogtreecommitdiff
path: root/include/linux/console_struct.h
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2020-06-15 09:48:34 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-24 17:08:31 +0200
commitb84ae3dc70fedf4bdee2dbfa487fd23b606fbb82 (patch)
tree8ac0566ef82fda9be4a0a77f8b29bb4cbabed2f2 /include/linux/console_struct.h
parent28bc24fc46f9c9f39ddefb424d6072041805b563 (diff)
vt: introduce enum vc_intensity for intensity
Introduce names (en enum) for 0, 1, and 2 constants. We now have VCI_HALF_BRIGHT, VCI_NORMAL, and VCI_BOLD instead. Apart from the cleanup, 1) the enum allows for better type checking, and 2) this saves some code. No more fiddling with bits is needed in assembly now. (OTOH, the structure is larger.) Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200615074910.19267-2-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.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index 162f4337c767..e901d98790bf 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -22,6 +22,13 @@ struct uni_screen;
#define NPAR 16
+enum vc_intensity {
+ VCI_HALF_BRIGHT,
+ VCI_NORMAL,
+ VCI_BOLD,
+ VCI_MASK = 0x3,
+};
+
/**
* struct vc_state -- state of a VC
* @x: cursor's x-position
@@ -30,7 +37,7 @@ struct uni_screen;
* @G0_charset: what's G0 slot set to (like GRAF_MAP, LAT1_MAP)
* @G1_charset: what's G1 slot set to (like GRAF_MAP, LAT1_MAP)
* @charset: what character set to use (0=G0 or 1=G1)
- * @intensity: 0=half-bright, 1=normal, 2=bold
+ * @intensity: see enum vc_intensity for values
* @reverse: reversed foreground/background colors
*
* These members are defined separately from struct vc_data as we save &
@@ -46,7 +53,7 @@ struct vc_state {
unsigned int charset : 1;
/* attribute flags */
- unsigned int intensity : 2;
+ enum vc_intensity intensity;
unsigned int italic : 1;
unsigned int underline : 1;
unsigned int blink : 1;