Commit e16cb6fe authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

tty/vt: consolemap: one line = one statement

Some lines combine more statements on one line. This makes the code hard
to follow. Do it properly in the "one line = one statement" fashion.
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20220607104946.18710-8-jslaby@suse.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d9ebb906
...@@ -215,12 +215,14 @@ static void set_inverse_transl(struct vc_data *conp, struct uni_pagedict *p, int ...@@ -215,12 +215,14 @@ static void set_inverse_transl(struct vc_data *conp, struct uni_pagedict *p, int
unsigned short *t = translations[i]; unsigned short *t = translations[i];
unsigned char *q; unsigned char *q;
if (!p) return; if (!p)
return;
q = p->inverse_translations[i]; q = p->inverse_translations[i];
if (!q) { if (!q) {
q = p->inverse_translations[i] = kmalloc(MAX_GLYPH, GFP_KERNEL); q = p->inverse_translations[i] = kmalloc(MAX_GLYPH, GFP_KERNEL);
if (!q) return; if (!q)
return;
} }
memset(q, 0, MAX_GLYPH); memset(q, 0, MAX_GLYPH);
...@@ -240,7 +242,8 @@ static void set_inverse_trans_unicode(struct vc_data *conp, ...@@ -240,7 +242,8 @@ static void set_inverse_trans_unicode(struct vc_data *conp,
u16 **p1, *p2; u16 **p1, *p2;
u16 *q; u16 *q;
if (!p) return; if (!p)
return;
q = p->inverse_trans_unicode; q = p->inverse_trans_unicode;
if (!q) { if (!q) {
q = p->inverse_trans_unicode = q = p->inverse_trans_unicode =
...@@ -412,7 +415,8 @@ static void con_release_unimap(struct uni_pagedict *p) ...@@ -412,7 +415,8 @@ static void con_release_unimap(struct uni_pagedict *p)
u16 **p1; u16 **p1;
int i, j; int i, j;
if (p == dflt) dflt = NULL; if (p == dflt)
dflt = NULL;
for (i = 0; i < UNI_DIRS; i++) { for (i = 0; i < UNI_DIRS; i++) {
p1 = p->uni_pgdir[i]; p1 = p->uni_pgdir[i];
if (p1 != NULL) { if (p1 != NULL) {
...@@ -458,7 +462,8 @@ static int con_unify_unimap(struct vc_data *conp, struct uni_pagedict *p) ...@@ -458,7 +462,8 @@ static int con_unify_unimap(struct vc_data *conp, struct uni_pagedict *p)
continue; continue;
for (j = 0; j < UNI_DIRS; j++) { for (j = 0; j < UNI_DIRS; j++) {
u16 **p1, **q1; u16 **p1, **q1;
p1 = p->uni_pgdir[j]; q1 = q->uni_pgdir[j]; p1 = p->uni_pgdir[j];
q1 = q->uni_pgdir[j];
if (!p1 && !q1) if (!p1 && !q1)
continue; continue;
if (!p1 || !q1) if (!p1 || !q1)
...@@ -492,19 +497,23 @@ con_insert_unipair(struct uni_pagedict *p, u_short unicode, u_short fontpos) ...@@ -492,19 +497,23 @@ con_insert_unipair(struct uni_pagedict *p, u_short unicode, u_short fontpos)
int i, n; int i, n;
u16 **p1, *p2; u16 **p1, *p2;
p1 = p->uni_pgdir[n = unicode >> 11]; n = unicode >> 11;
p1 = p->uni_pgdir[n];
if (!p1) { if (!p1) {
p1 = p->uni_pgdir[n] = kmalloc_array(UNI_DIR_ROWS, p1 = p->uni_pgdir[n] = kmalloc_array(UNI_DIR_ROWS,
sizeof(u16 *), GFP_KERNEL); sizeof(u16 *), GFP_KERNEL);
if (!p1) return -ENOMEM; if (!p1)
return -ENOMEM;
for (i = 0; i < UNI_DIR_ROWS; i++) for (i = 0; i < UNI_DIR_ROWS; i++)
p1[i] = NULL; p1[i] = NULL;
} }
p2 = p1[n = (unicode >> 6) & 0x1f]; n = (unicode >> 6) & 0x1f;
p2 = p1[n];
if (!p2) { if (!p2) {
p2 = p1[n] = kmalloc_array(UNI_ROW_GLYPHS, sizeof(u16), GFP_KERNEL); p2 = p1[n] = kmalloc_array(UNI_ROW_GLYPHS, sizeof(u16), GFP_KERNEL);
if (!p2) return -ENOMEM; if (!p2)
return -ENOMEM;
/* No glyphs for the characters (yet) */ /* No glyphs for the characters (yet) */
memset(p2, 0xff, UNI_ROW_GLYPHS * sizeof(u16)); memset(p2, 0xff, UNI_ROW_GLYPHS * sizeof(u16));
} }
...@@ -532,7 +541,8 @@ static int con_do_clear_unimap(struct vc_data *vc) ...@@ -532,7 +541,8 @@ static int con_do_clear_unimap(struct vc_data *vc)
q->refcount=1; q->refcount=1;
*vc->vc_uni_pagedir_loc = q; *vc->vc_uni_pagedir_loc = q;
} else { } else {
if (p == dflt) dflt = NULL; if (p == dflt)
dflt = NULL;
p->refcount++; p->refcount++;
p->sum = 0; p->sum = 0;
con_release_unimap(p); con_release_unimap(p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment