aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/console/sticon.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2021-12-13 10:48:46 +0100
committerIngo Molnar <mingo@kernel.org>2021-12-13 10:48:46 +0100
commit6773cc31a9bb5122fd5c288f73ca006ad20a6c17 (patch)
tree730ec8bcc0a5ddd5030268bb3ffd4945d34728c1 /drivers/video/console/sticon.c
parentfutex: Fix additional regressions (diff)
parentLinux 5.16-rc5 (diff)
downloadlinux-dev-6773cc31a9bb5122fd5c288f73ca006ad20a6c17.tar.xz
linux-dev-6773cc31a9bb5122fd5c288f73ca006ad20a6c17.zip
Merge tag 'v5.16-rc5' into locking/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/video/console/sticon.c')
-rw-r--r--drivers/video/console/sticon.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/video/console/sticon.c b/drivers/video/console/sticon.c
index 1b451165311c..40496e9e9b43 100644
--- a/drivers/video/console/sticon.c
+++ b/drivers/video/console/sticon.c
@@ -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)