Commit f3205b29 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman
Browse files

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: default avatarJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20200615074910.19267-21-jslaby@suse.cz


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6923e2d7
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -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,16 +2769,12 @@ static int vc_con_write_normal(struct vc_data *vc, int tc, int c,
				tc = conv_uni_to_pc(vc, '?');
				if (tc < 0)
					tc = '?';
			}
		}
	}

	if (!inverse) {
		vc_attr = vc->vc_attr;
	} else {
				vc_attr = vc_invert_attr(vc);
				con_flush(vc, draw);
			}
		}
	}

	next_c = c;
	while (1) {