lkml.org 
[lkml]   [2023]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 05/11] tty: vt: remove char32_t typedef
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@kernel.org>
> ---
> 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.

\
 
 \ /
  Last update: 2023-03-26 23:37    [W:0.083 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site