[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/3] xen/console: Fix incorrect format tags for struct tm members
- To: Michal Orzel <michal.orzel@xxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Fri, 10 Jun 2022 11:56:05 +0200
- 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LIYl3OLZsTob8KuTnflsjwhyQ3SXczRH81zuCj0PO9c=; b=iyIw2N2w9WSCMXzGlFaXhOSQZcMOXhJ32JW0TfPVwaz0cCmWEjfAZyi1+4kuTUG56A1gWOerGE+EjzDidv+V5BGkTziVjFqh5osERFqWlo90vd3o+xvOBuiOEHA6LAz9xj7HmYoM9rl8oVjLXAs9t3uynxxxnAKtcq7H3jVArMp5qStSQMBs7/l6db53SRz3sKKNcHP4W6hEdTZ0bG4dH7w7+j2vjwAXgbVIUKXFsSxRE/v3c7OJIRyqGQY9LYpOLRmyUodQIFjNGf8XCaEyacNZWtcsm463xZV3f2kCo44gb0oZSYrSFAq0scEGcSDdCZ6GAQ3yaJE4fNoRFzUlhA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dCzAxoHXE1WAz1Trt1jLT87lsxdwtOgsMzttwF4McT3KVCBKMQFRpsHxjIgUydfX9pl0YV7iCC66UZwOm4UWetrGu8nVKcihhVqc5MzJaShYUdbZYis9KrVSwoecz2rMtMHJPBdPfxrBYvVRF+nlL6fA0fl2Wcs4XIkesyWfLQNgIDsGOmiBoGt4nf1yf+OYzH2Hj3rV8xQgXgJJzQu3Bw+KcpWw8/GO+8SfopbKC5cqMkPdX5CEuuk8QHt2SQA7YbESiwDYZVglQQF1pIvzJlgnOM6Ts3h3TfxTCh92tnJaJTOsqBW0rdGtRHJEWpxxe9PfLopsR3MX/mWAEeGFfw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Fri, 10 Jun 2022 09:56:14 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 10.06.2022 11:50, Michal Orzel wrote:
> On 10.06.2022 11:44, Jan Beulich wrote:
>> On 10.06.2022 10:33, Michal Orzel wrote:
>>> All the members of struct tm are defined as integers but the format tags
>>> used in console driver for snprintf wrongly expect unsigned values. Fix
>>> the tags to expect integers.
>>
>> Perhaps do things the other way around - convert field types to unsigned
>> unless negative values can be stored there? This would match our general
>> aim of using unsigned types when only non-negative values can be held in
>> variables / parameters / fields.
>>
>
> The reason why I did not do this is to be coherent with Linux kernel
> (include/linux/time.h).
> I believe the time.h code in Xen comes from Linux.
>
> So if the Linux time.h defines these fields as integers and uses proper %d
> format specifiers (unlike Xen),
> I think my solution is better.
One can view it that way, sure. I don't. But I also won't nak this change.
Jan
|