summaryrefslogtreecommitdiff
path: root/drivers/tty/vt/consolemap.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2022-06-07 13:49:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-10 14:37:02 +0300
commitf052f62c23b330717773b61bea19003e2e6a9ba2 (patch)
tree60fb51cc60896f943565b276773492b4ecad1044 /drivers/tty/vt/consolemap.c
parent5a904a936b407624cd1ff5ee3f1675ca3d2366a5 (diff)
downloadlinux-f052f62c23b330717773b61bea19003e2e6a9ba2.tar.xz
tty/vt: consolemap: remove glyph < 0 check from set_inverse_trans_unicode()
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> Link: https://lore.kernel.org/r/20220607104946.18710-18-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt/consolemap.c')
-rw-r--r--drivers/tty/vt/consolemap.c7
1 files 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);
}
}