On 07.06.2025 01:06, dm...@proton.me wrote:
> On Fri, Jun 06, 2025 at 08:24:44PM +0000, Teddy Astie wrote:
>> Le 06/06/2025 à 21:51, dm...@proton.me a écrit :
>>> --- a/xen/drivers/char/console.c
>>> +++ b/xen/drivers/char/console.c
>>> @@ -769,22 +769,25 @@ static long 
>>> guest_console_write(XEN_GUEST_HANDLE_PARAM(char) buffer,
>>>               } while ( --kcount > 0 );
>>>
>>>               *kout = '\0';
>>> -            spin_lock(&cd->pbuf_lock);
>>> +            spin_lock(&cd->console.pbuf_lock);
>>>               kcount = kin - kbuf;
>>>               if ( c != '\n' &&
>>> -                 (cd->pbuf_idx + (kout - kbuf) < (DOMAIN_PBUF_SIZE - 1)) )
>>> +                 cd->console.pbuf_idx + kout - kbuf < DOMAIN_PBUF_SIZE - 1 
>>> )
>>
>> I don't think we want to drop the parentheses here.

I don't see any issue with doing so - they don't serve much of a purpose here.

> The line will will exceed 80 chars if I keep parentheses.
> 
> Will something like the following work:
> 
> -                 (cd->pbuf_idx + (kout - kbuf) < (DOMAIN_PBUF_SIZE - 1)) )
> +                 (cd->console.pbuf_idx + (kout - kbuf) <
> +                    (DOMAIN_PBUF_SIZE - 1)) )
> 
> ?

Well, indentation of the latter of the two new lines is two too deep, as it
looks.

Jan

Reply via email to