[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ss849930-nr48-q998-oo41-3qs64or91670@syhkavp.arg>
Date: Wed, 7 May 2025 10:04:16 -0400 (EDT)
From: Nicolas Pitre <nico@...xnic.net>
To: Jiri Slaby <jirislaby@...nel.org>
cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
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 Tue, 6 May 2025, Jiri Slaby wrote:
> 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?
I used the `size`command which lumps .text and .rodata together. In
reality .rodata goes down and .text goes up a little, and the end result
is the combined text size.
> > --- 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«.
Uh... why? Having both as numerical value is more meaningful and clearer
here IMHO.
Nicolas
Powered by blists - more mailing lists