summaryrefslogtreecommitdiff
path: root/drivers/tty/vt/vt.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2020-06-15 10:48:53 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-24 18:08:33 +0300
commitf3205b29be7a18a198491004d058f3fc9d6eaf79 (patch)
tree04099bf65e307bd7bcb73272621044a23684a721 /drivers/tty/vt/vt.c
parent6923e2d793213283d808e60c390fe0b5e9090c7e (diff)
downloadlinux-f3205b29be7a18a198491004d058f3fc9d6eaf79.tar.xz
vt: simplify vc_attr handling in vc_con_write_normal
Invert the attribute on the only place, without the need of checking 'inverse'. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200615074910.19267-21-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt/vt.c')
-rw-r--r--drivers/tty/vt/vt.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index d3cd256ba0fa..72ae8ede1ac9 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -2730,7 +2730,7 @@ static int vc_con_write_normal(struct vc_data *vc, int tc, int c,
struct vc_draw_region *draw)
{
int next_c;
- unsigned char vc_attr;
+ unsigned char vc_attr = vc->vc_attr;
u16 himask = vc->vc_hi_font_mask, charmask = himask ? 0x1ff : 0xff;
u8 width = 1;
bool inverse = false;
@@ -2769,17 +2769,13 @@ static int vc_con_write_normal(struct vc_data *vc, int tc, int c,
tc = conv_uni_to_pc(vc, '?');
if (tc < 0)
tc = '?';
+
+ vc_attr = vc_invert_attr(vc);
+ con_flush(vc, draw);
}
}
}
- if (!inverse) {
- vc_attr = vc->vc_attr;
- } else {
- vc_attr = vc_invert_attr(vc);
- con_flush(vc, draw);
- }
-
next_c = c;
while (1) {
if (vc->vc_need_wrap || vc->vc_decim)