[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v2 1/4] xen/console: Don't treat NUL character as the end of the buffer
- To: Julien Grall <julien.grall@xxxxxxx>
- From: Jan Beulich <JBeulich@xxxxxxxx>
- Date: Thu, 8 Aug 2019 15:01:55 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PpXDb0cpjoMQ7wHmOkF4E/r764mu6leVcpJ90pq/mDA=; b=Y+I+4+a2z3s3+PbY7ZtWoni0jTtwTCtAsC6UzIjc7XbCxkv/MHWELjUnVmmLUL2+s3cT9SNL4ieOlEfkI8bZdEBZJ9F5EF7ICNTNbiQDEosaOBRZR2vToL6hW0XDTNRHVciCI0EJtuYiY+y531rSPnBgruS1r6Sl0eVRuCtDipgMMrOC1SkwTClUZ15vgEMuGskJk53RcDIUQghrkmOjIhYwXdfusaDNbMJGg019ceAZlMao43V309rmiy89EcXzb5WU6kmJ0X4GgjFr1bAL5JY5MykJpfUNHNJlPg1RMENOO3khfiKBuhuvzy7Cub6h4lUR2i0+3TjRhlxpOlGMqA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LKMn/SrqqqZ2odHN0WOs/0Zsn0ECAsXp/h3XRYnqJZ2i318CBRaLQZOrups7aAYmhMqg8nF2IOqZ3Oii+ibacEFSDIjdCIbQ3AImBrjJqfIJsxFdBPE1wc+tXlglT7wFAeB0hJP5Ch9lX3+73ZJwVMizHFiFO8xxmsCrLAu0bgri7Uo6M3tVzA2PBAggli5OG60ek1kvTm8urrKQiZr4t+79/LT64Qh/UPvYyWiTfB7V35MJyoleiczyWFnBEmsGknUm2UV9zu4rT+Hdy0UBmFYK4kFyWoRW6i6e1vvr3YTNVVNnLY+4QATo+sJPhFW4OK2ChYSQeiNoj5R7CIht5g==
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Thu, 08 Aug 2019 15:10:30 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHVS5HylAe3eE1UcUur5OQYZ6SMtKbxSYOAgAAFgJiAAA5CAA==
- Thread-topic: [PATCH v2 1/4] xen/console: Don't treat NUL character as the end of the buffer
On 08.08.2019 16:10, Julien Grall wrote:
> On 08/08/2019 14:51, Jan Beulich wrote:
>> On 05.08.2019 15:29, Julien Grall wrote:
>>> --- a/xen/include/xen/video.h
>>> +++ b/xen/include/xen/video.h
>>> @@ -13,11 +13,11 @@
>>> #ifdef CONFIG_VIDEO
>>> void video_init(void);
>>> -extern void (*video_puts)(const char *);
>>> +extern void (*video_puts)(const char *, size_t nr);
>>> void video_endboot(void);
>>> #else
>>> #define video_init() ((void)0)
>>> -#define video_puts(s) ((void)0)
>>> +#define video_puts(s, nr) ((void)0)
>>
>> While I don't think there's overly much risk of "s" getting an
>> argument with side effects passed, I think that for "nr" the
>> risk is there. May I ask that you evaluate both here, just in
>> case?
>
> Are you happy with the following code (Not yet compiled!):
>
> #define video_ptus(s, nr) ((void)(s), (void)(nr))
With s/ptus/puts/ - sure. A static inline might be another
(even better) option.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|