Re: [PATCH 05/11] tty: vt: remove char32_t typedef

From: Ilpo Järvinen
Date: Thu Jan 12 2023 - 04:41:30 EST


On Thu, 12 Jan 2023, Jiri Slaby (SUSE) wrote:

> It boils down to uint32_t, so use u32 directly, instead. This makes the
> code more obvious.
>
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@xxxxxxxxxx>
> ---
> drivers/tty/vt/vt.c | 26 ++++++++++++--------------
> 1 file changed, 12 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> index 3ae0212f1aa7..86c18522231b 100644
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c

> @@ -550,7 +548,7 @@ void vc_uniscr_copy_line(const struct vc_data *vc, void *dest, bool viewed,
> */
> row = (pos - vc->vc_origin) / vc->vc_size_row;
> col = ((pos - vc->vc_origin) % vc->vc_size_row) / 2;
> - memcpy(dest, &uniscr->lines[row][col], nr * sizeof(char32_t));
> + memcpy(dest, &uniscr->lines[row][col], nr * sizeof(u32));

Btw, could this be ... * sizeof(**uniscr->lines) instead? It would seem
slightly safer here.

--
i.