Commit c5c717e7 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

vt: simplify noncolor attributes in build_attr

All the attributes are bools, so do a simple shift instead of tests and
constants as bool is either 0 or 1.
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20200615074910.19267-28-jslaby@suse.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent faace51b
......@@ -719,10 +719,10 @@ static u8 build_attr(struct vc_data *vc, u8 _color,
u8 a = _color;
if (!vc->vc_can_do_color)
return _intensity |
(_italic ? 2 : 0) |
(_underline ? 4 : 0) |
(_reverse ? 8 : 0) |
(_blink ? 0x80 : 0);
(_italic << 1) |
(_underline << 2) |
(_reverse << 3) |
(_blink << 7);
if (_italic)
a = (a & 0xF0) | vc->vc_itcolor;
else if (_underline)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment