Re: [PATCH v7 3/7] xen/console: use memcpy() in conring_puts()
| Newsgroups | org.xenproject.lists.xen-devel |
|---|---|
| Message-ID | <alnJI+8Whp3ES3Hz@kraken> |
On Thu, Jul 16, 2026 at 06:08:01PM +0200, Jan Beulich wrote: > 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. Thanks for taking a look! I don't think there ever will callers of conring_puts() with strings longer than conring_size... and I could not decide whether to keep the extra check or not. Will update the code with a commentary.