Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e8463c4 authored by Sven Schnelle's avatar Sven Schnelle Committed by Greg Kroah-Hartman
Browse files

parisc/sticon: fix reverse colors



commit bec05f33ebc1006899c6d3e59a00c58881fe7626 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: default avatarSven Schnelle <svens@stackframe.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bd660a20
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -316,13 +316,13 @@ static unsigned long sticon_getxy(struct vc_data *conp, unsigned long pos,
static u8 sticon_build_attr(struct vc_data *conp, u8 color, u8 intens,
static u8 sticon_build_attr(struct vc_data *conp, u8 color, u8 intens,
			    u8 blink, u8 underline, u8 reverse, u8 italic)
			    u8 blink, u8 underline, u8 reverse, u8 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)