Commit bec05f33 authored by Sven Schnelle's avatar Sven Schnelle Committed by Helge Deller

parisc/sticon: fix reverse colors

sticon_build_attr() checked the reverse argument and flipped
background and foreground color, but returned the non-reverse
value afterwards. Fix this and also add two local variables
for foreground and background color to make the code easier
to read.
Signed-off-by: default avatarSven Schnelle <svens@stackframe.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent fa55b7dc
......@@ -332,13 +332,13 @@ static u8 sticon_build_attr(struct vc_data *conp, u8 color,
bool blink, bool underline, bool reverse,
bool italic)
{
u8 attr = ((color & 0x70) >> 1) | ((color & 7));
u8 fg = color & 7;
u8 bg = (color & 0x70) >> 4;
if (reverse) {
color = ((color >> 3) & 0x7) | ((color & 0x7) << 3);
}
return attr;
if (reverse)
return (fg << 3) | bg;
else
return (bg << 3) | fg;
}
static void sticon_invert_region(struct vc_data *conp, u16 *p, int count)
......
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