summaryrefslogtreecommitdiffstats
path: root/drivers/tty/vt
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2020-06-15 09:48:35 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-24 17:08:31 +0200
commit77bc14f273c2dfecbf87f41fdc00345d99597e13 (patch)
treee343f0d17484052cc52aa66b2ea5c11f9b6d4ff2 /drivers/tty/vt
parentvt: introduce enum vc_intensity for intensity (diff)
downloadlinux-77bc14f273c2dfecbf87f41fdc00345d99597e13.tar.xz
linux-77bc14f273c2dfecbf87f41fdc00345d99597e13.zip
vc: switch state to bool
The code currently uses bitfields to store true-false values. Switch all of that to bools. Apart from the cleanup, it saves 20B of code as many shifts, ANDs, and ORs became simple movzb's. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200615074910.19267-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt')
-rw-r--r--drivers/tty/vt/vt.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 71bf483e5640..26cb1fc48b27 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -706,8 +706,8 @@ void update_region(struct vc_data *vc, unsigned long start, int count)
/* Structure of attributes is hardware-dependent */
static u8 build_attr(struct vc_data *vc, u8 _color,
- enum vc_intensity _intensity, u8 _blink, u8 _underline,
- u8 _reverse, u8 _italic)
+ enum vc_intensity _intensity, bool _blink, bool _underline,
+ bool _reverse, bool _italic)
{
if (vc->vc_sw->con_build_attr)
return vc->vc_sw->con_build_attr(vc, _color, _intensity,
@@ -755,8 +755,8 @@ static void update_attr(struct vc_data *vc)
vc->state.blink, vc->state.underline,
vc->state.reverse ^ vc->vc_decscnm, vc->state.italic);
vc->vc_video_erase_char = ' ' | (build_attr(vc, vc->state.color,
- VCI_NORMAL, vc->state.blink, 0, vc->vc_decscnm,
- 0) << 8);
+ VCI_NORMAL, vc->state.blink, false,
+ vc->vc_decscnm, false) << 8);
}
/* Note: inverting the screen twice should revert to the original state */
@@ -1614,10 +1614,10 @@ static void csi_X(struct vc_data *vc, int vpar) /* erase the following vpar posi
static void default_attr(struct vc_data *vc)
{
vc->state.intensity = VCI_NORMAL;
- vc->state.italic = 0;
- vc->state.underline = 0;
- vc->state.reverse = 0;
- vc->state.blink = 0;
+ vc->state.italic = false;
+ vc->state.underline = false;
+ vc->state.reverse = false;
+ vc->state.blink = false;
vc->state.color = vc->vc_def_color;
}
@@ -1723,7 +1723,7 @@ static void csi_m(struct vc_data *vc)
vc->state.intensity = VCI_HALF_BRIGHT;
break;
case 3:
- vc->state.italic = 1;
+ vc->state.italic = true;
break;
case 21:
/*
@@ -1731,13 +1731,13 @@ static void csi_m(struct vc_data *vc)
* convert it to a single underline.
*/
case 4:
- vc->state.underline = 1;
+ vc->state.underline = true;
break;
case 5:
- vc->state.blink = 1;
+ vc->state.blink = true;
break;
case 7:
- vc->state.reverse = 1;
+ vc->state.reverse = true;
break;
case 10: /* ANSI X3.64-1979 (SCO-ish?)
* Select primary font, don't display control chars if
@@ -1769,16 +1769,16 @@ static void csi_m(struct vc_data *vc)
vc->state.intensity = VCI_NORMAL;
break;
case 23:
- vc->state.italic = 0;
+ vc->state.italic = false;
break;
case 24:
- vc->state.underline = 0;
+ vc->state.underline = false;
break;
case 25:
- vc->state.blink = 0;
+ vc->state.blink = false;
break;
case 27:
- vc->state.reverse = 0;
+ vc->state.reverse = false;
break;
case 38:
i = vc_t416_color(vc, i, rgb_foreground);