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

tty/vt: consolemap: saner variable names in con_get_unimap()

The function uses too vague variable names like i, j, k for iterators, p,
q, p1, p2 for pointers etc.

Rename all these, so that it is clear what is going on:
- dict: for dictionaries.
- d, r, g: for dir, row, glyph iterators -- these are unsigned now.
- dir, row: for directory and row pointers.
- glyph: for the glyph.
- and so on...
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20220607104946.18710-28-jslaby@suse.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3315f1aa
...@@ -773,11 +773,11 @@ EXPORT_SYMBOL(con_copy_unimap); ...@@ -773,11 +773,11 @@ EXPORT_SYMBOL(con_copy_unimap);
int con_get_unimap(struct vc_data *vc, ushort ct, ushort __user *uct, int con_get_unimap(struct vc_data *vc, ushort ct, ushort __user *uct,
struct unipair __user *list) struct unipair __user *list)
{ {
int i, j, k, ret = 0;
ushort ect; ushort ect;
u16 **p1, *p2; struct uni_pagedict *dict;
struct uni_pagedict *p;
struct unipair *unilist; struct unipair *unilist;
unsigned int d, r, g;
int ret = 0;
unilist = kvmalloc_array(ct, sizeof(*unilist), GFP_KERNEL); unilist = kvmalloc_array(ct, sizeof(*unilist), GFP_KERNEL);
if (!unilist) if (!unilist)
...@@ -786,26 +786,26 @@ int con_get_unimap(struct vc_data *vc, ushort ct, ushort __user *uct, ...@@ -786,26 +786,26 @@ int con_get_unimap(struct vc_data *vc, ushort ct, ushort __user *uct,
console_lock(); console_lock();
ect = 0; ect = 0;
p = *vc->vc_uni_pagedir_loc; dict = *vc->vc_uni_pagedir_loc;
if (!p) if (!dict)
goto unlock; goto unlock;
for (i = 0; i < UNI_DIRS; i++) { for (d = 0; d < UNI_DIRS; d++) {
p1 = p->uni_pgdir[i]; u16 **dir = dict->uni_pgdir[d];
if (!p1) if (!dir)
continue; continue;
for (j = 0; j < UNI_DIR_ROWS; j++, p1++) { for (r = 0; r < UNI_DIR_ROWS; r++) {
p2 = *p1; u16 *row = dir[r];
if (!p2) if (!row)
continue; continue;
for (k = 0; k < UNI_ROW_GLYPHS; k++, p2++) { for (g = 0; g < UNI_ROW_GLYPHS; g++, row++) {
if (*p2 >= MAX_GLYPH) if (*row >= MAX_GLYPH)
continue; continue;
if (ect < ct) { if (ect < ct) {
unilist[ect].unicode = UNI(i, j, k); unilist[ect].unicode = UNI(d, r, g);
unilist[ect].fontpos = *p2; unilist[ect].fontpos = *row;
} }
ect++; ect++;
} }
......
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