parisc/sticon: fix reverse colors
commit bec05f33eb
upstream.
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: Sven Schnelle <svens@stackframe.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
61b26492e7
Коммит
a1c9455f10
|
@ -332,13 +332,13 @@ static u8 sticon_build_attr(struct vc_data *conp, u8 color,
|
||||||
bool blink, bool underline, bool reverse,
|
bool blink, bool underline, bool reverse,
|
||||||
bool italic)
|
bool italic)
|
||||||
{
|
{
|
||||||
u8 attr = ((color & 0x70) >> 1) | ((color & 7));
|
u8 fg = color & 7;
|
||||||
|
u8 bg = (color & 0x70) >> 4;
|
||||||
|
|
||||||
if (reverse) {
|
if (reverse)
|
||||||
color = ((color >> 3) & 0x7) | ((color & 0x7) << 3);
|
return (fg << 3) | bg;
|
||||||
}
|
else
|
||||||
|
return (bg << 3) | fg;
|
||||||
return attr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sticon_invert_region(struct vc_data *conp, u16 *p, int count)
|
static void sticon_invert_region(struct vc_data *conp, u16 *p, int count)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче