Commit 61fe4a6b authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman
Browse files

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



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-21-jslaby@suse.cz


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 50c92a1b
Loading
Loading
Loading
Loading
+8 −9
Original line number Original line Diff line number Diff line
@@ -852,9 +852,8 @@ int conv_uni_to_8bit(u32 uni)
int
int
conv_uni_to_pc(struct vc_data *conp, long ucs) 
conv_uni_to_pc(struct vc_data *conp, long ucs) 
{
{
	int h;
	struct uni_pagedict *dict;
	u16 **p1, *p2;
	u16 **dir, *row, glyph;
	struct uni_pagedict *p;


	/* Only 16-bit codes supported at this time */
	/* Only 16-bit codes supported at this time */
	if (ucs > 0xffff)
	if (ucs > 0xffff)
@@ -874,11 +873,11 @@ conv_uni_to_pc(struct vc_data *conp, long ucs)
	if (!*conp->vc_uni_pagedir_loc)
	if (!*conp->vc_uni_pagedir_loc)
		return -3;
		return -3;


	p = *conp->vc_uni_pagedir_loc;
	dict = *conp->vc_uni_pagedir_loc;
	if ((p1 = p->uni_pgdir[UNI_DIR(ucs)]) &&
	if ((dir = dict->uni_pgdir[UNI_DIR(ucs)]) &&
	    (p2 = p1[UNI_ROW(ucs)]) &&
	    (row = dir[UNI_ROW(ucs)]) &&
	    (h = p2[UNI_GLYPH(ucs)]) < MAX_GLYPH)
	    (glyph = row[UNI_GLYPH(ucs)]) < MAX_GLYPH)
		return h;
		return glyph;


	return -4;		/* not found */
	return -4;		/* not found */
}
}