All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Juergen Gross <jgross@suse.com>, Michal Orzel <michal.orzel@arm.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 3/3] xen/console: Fix incorrect format tags for struct tm members
Date: Fri, 10 Jun 2022 11:55:12 +0200	[thread overview]
Message-ID: <295e9c7e-e0de-bbd3-eec4-0864cb2ef086@suse.com> (raw)
In-Reply-To: <2ccd52a7-a5b2-c221-b847-ed0c9de2effd@suse.com>

On 10.06.2022 11:51, Juergen Gross wrote:
> On 10.06.22 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.
> 
> Don't you think keeping struct tm in sync with the Posix definition should
> be preferred here?

Not necessarily, no. It's not just POSIX which has a (imo bad) habit of
using plain "int" even for values which can never go negative.

Jan


  reply	other threads:[~2022-06-10  9:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10  8:33 [PATCH 0/3] small fixes Michal Orzel
2022-06-10  8:33 ` [PATCH 1/3] xen/arm: traps: Fix reference to invalid erratum ID Michal Orzel
2022-06-10  9:09   ` Julien Grall
2022-06-10  8:33 ` [PATCH 2/3] xen/arm: gicv2: Rename gicv2_map_hwdown_extra_mappings Michal Orzel
2022-06-10  9:07   ` Julien Grall
2022-06-10  9:41     ` Michal Orzel
2022-06-10  8:33 ` [PATCH 3/3] xen/console: Fix incorrect format tags for struct tm members Michal Orzel
2022-06-10  9:44   ` Jan Beulich
2022-06-10  9:50     ` Michal Orzel
2022-06-10  9:56       ` Jan Beulich
2022-06-10  9:51     ` Juergen Gross
2022-06-10  9:55       ` Jan Beulich [this message]
2022-06-10 23:35         ` Stefano Stabellini
2022-06-13  6:49           ` Michal Orzel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=295e9c7e-e0de-bbd3-eec4-0864cb2ef086@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.