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 18/36] tty/vt: consolemap: remove glyph < 0 check from set_inverse_trans_unicode()
Date
glyph is now an int casted from u16. It can never be negative. So remove
the check and type glyph as u16 properly in set_inverse_trans_unicode().

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

diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c
index 80536687acef..733795a3dc68 100644
--- a/drivers/tty/vt/consolemap.c
+++ b/drivers/tty/vt/consolemap.c
@@ -244,7 +244,7 @@ static void set_inverse_transl(struct vc_data *conp, struct uni_pagedict *p,
static void set_inverse_trans_unicode(struct vc_data *conp,
struct uni_pagedict *p)
{
- int i, j, k, glyph;
+ int i, j, k;
u16 **p1, *p2;
u16 *q;

@@ -268,9 +268,8 @@ static void set_inverse_trans_unicode(struct vc_data *conp,
if (!p2)
continue;
for (k = 0; k < UNI_ROW_GLYPHS; k++) {
- glyph = p2[k];
- if (glyph >= 0 && glyph < MAX_GLYPH
- && q[glyph] < 32)
+ u16 glyph = p2[k];
+ if (glyph < MAX_GLYPH && q[glyph] < 32)
q[glyph] = UNI(i, j, k);
}
}
--
2.36.1
\
 
 \ /
  Last update: 2022-06-07 12:55    [W:0.416 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site