Commit 2097dc22 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman
Browse files

tty/vt: consolemap: decrypt inverse_translate()



Fix invalid indentation and demystify the code by removing superfluous
"else"s. The "else"s are unneeded as they always follow an "if"-true
branch containing a "return". The code is now way more readable.

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


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent db8f597a
Loading
Loading
Loading
Loading
+16 −15
Original line number Diff line number Diff line
@@ -285,26 +285,27 @@ u16 inverse_translate(const struct vc_data *conp, int glyph, int use_unicode)
{
	struct uni_pagedict *p;
	int m;

	if (glyph < 0 || glyph >= MAX_GLYPH)
		return 0;
	else {

	p = *conp->vc_uni_pagedir_loc;
	if (!p)
		return glyph;
		else if (use_unicode) {

	if (use_unicode) {
		if (!p->inverse_trans_unicode)
			return glyph;
			else

		return p->inverse_trans_unicode[glyph];
			} else {
	}

	m = inv_translate[conp->vc_num];
	if (!p->inverse_translations[m])
		return glyph;
			else

	return p->inverse_translations[m][glyph];
}
	}
}
EXPORT_SYMBOL_GPL(inverse_translate);

static void update_user_maps(void)