lkml.org 
[lkml]   [2022]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 09/36] tty/vt: consolemap: use | for binary addition
Date
Unicode letters are composed as a bit shifts and sums of three values.
Use "|" and not "+" for these bit operations. The former is indeed more
appropriate.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/tty/vt/consolemap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c
index f97081e01b71..016c1a0b4290 100644
--- a/drivers/tty/vt/consolemap.c
+++ b/drivers/tty/vt/consolemap.c
@@ -265,7 +265,7 @@ static void set_inverse_trans_unicode(struct vc_data *conp,
glyph = p2[k];
if (glyph >= 0 && glyph < MAX_GLYPH
&& q[glyph] < 32)
- q[glyph] = (i << 11) + (j << 6) + k;
+ q[glyph] = (i << 11) | (j << 6) | k;
}
}
}
@@ -788,7 +788,7 @@ int con_get_unimap(struct vc_data *vc, ushort ct, ushort __user *uct, struct uni
continue;
if (ect < ct) {
unilist[ect].unicode =
- (i<<11)+(j<<6)+k;
+ (i<<11) | (j<<6) | k;
unilist[ect].fontpos = *p2;
}
ect++;
--
2.36.1
\
 
 \ /
  Last update: 2022-06-07 12:54    [W:0.413 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site