Re: [PATCH v7 3/7] xen/console: use memcpy() in conring_puts()

Jan Beulich <[email protected]>
Newsgroups org.xenproject.lists.xen-devel
Message-ID <[email protected]>
On 13.07.2026 20:16, [email protected] wrote:
> --- a/xen/drivers/char/console.c
> +++ b/xen/drivers/char/console.c
> @@ -360,12 +360,22 @@ static DECLARE_SOFTIRQ_TASKLET(conring_tasklet, conring_notify, NULL);
>  /* NB: Do not send conring VIRQs during panic. */
>  static bool conring_no_notify;
>  
> -static void conring_puts(const char *str, size_t len)
> +static void conring_puts(const char *str, unsigned int len)
>  {
> +    unsigned int src = likely(len < conring_size) ? 0 : len - conring_size;

Isn't the attempt to handle strings longer than conring_size pretty much in
vain? Things look correct as far as the rest of the logic in the function
goes, but is this useful? It certainly warrants at least a brief comment imo.

Jan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.