[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <58ee071e-b2d9-4e1a-b150-c2be59827676@kernel.org>
Date: Tue, 6 May 2025 07:55:59 +0200
From: Jiri Slaby <jirislaby@...nel.org>
To: Nicolas Pitre <nico@...xnic.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Nicolas Pitre <npitre@...libre.com>, linux-serial@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 8/8] vt: process the full-width ASCII fallback range
programmatically
On 05. 05. 25, 18:55, Nicolas Pitre wrote:
> From: Nicolas Pitre <npitre@...libre.com>
>
> This saves about 258 bytes of text.
You mean .rodata, actually?
> --- a/drivers/tty/vt/ucs.c
> +++ b/drivers/tty/vt/ucs.c
> @@ -222,5 +222,13 @@ u32 ucs_get_fallback(u32 cp)
> if (single)
> return ucs_fallback_singles_subs[single - ucs_fallback_singles];
>
> + /*
> + * Full-width to ASCII mapping (covering all printable ASCII 33-126)
> + * 0xFF01 (!) to 0xFF5E (~) -> ASCII 33 (!) to 126 (~)
> + * We process them programmatically to reduce the table size.
> + */
> + if (cp >= 0xFF01 && cp <= 0xFF5E)
> + return cp - 0xFF01 + 33;
So do really »+ '!'« instead of »+ 33«.
thanks,
--
js
suse labs
Powered by blists - more mailing lists