From: Peter Maydell <peter.maydell@linaro.org>
To: Antoine Mathys <barsamin@gmail.com>
Cc: qemu-devel@nongnu.org, paul@codesourcery.com
Subject: Re: [Qemu-devel] [PATCH 1/4] hw/ds1338.c: Fix handling of HOURS register.
Date: Tue, 4 Dec 2012 21:10:26 +0000 [thread overview]
Message-ID: <CAFEAcA8EkLUSyF0aEBuB5udPoxRxLwd8wJN4wDJRua5Vyb5cRA@mail.gmail.com> (raw)
In-Reply-To: <50BE63C7.9080402@gmail.com>
On 4 December 2012 20:57, Antoine Mathys <barsamin@gmail.com> wrote:
> On 12/04/2012 06:42 PM, Peter Maydell wrote:
>> This looks good as far as the logic goes, but I think we could use some
>> symbolic constants for the 12-hour and PM bits rather than all the literal
>> 0x20 0x40 0x60. thanks -- PMM
>
> I refrained from using symbolic constants for three reasons:
> 1. You need to refer to the datasheet anyway to understand what is going on.
> 2. The code is short and it is easy to keep track of a few constants.
> 3. Symbolic names, which can be quite long, tend to make the code harder
> rather than easier to read
...I had the datasheet open and I still had to bounce back and forth
several times to work out which bits you were working with, so I
think we definitely disagree on this point...
> It is largely a matter of preference though and I'm not opposed to the idea.
> I would appreciate naming suggestions though.
>
> I propose not to have symbolic constants for the registers and to use CH,
> OSF, MODE12, PM for the various bits, provided such short names are
> acceptable. I'd really hate something like REG_HOURS_MODE12.
Your suggestions are definitely way too short; I'd go for something
in the middle like CTRL_OSF and HOURS_12HR, HOURS_PM.
-- PMM
prev parent reply other threads:[~2012-12-04 21:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-02 17:14 [Qemu-devel] [PATCH 1/4] hw/ds1338.c: Fix handling of HOURS register Antoine Mathys
2012-12-04 17:42 ` Peter Maydell
2012-12-04 18:53 ` Andreas Färber
2012-12-04 20:57 ` Antoine Mathys
2012-12-04 21:10 ` Peter Maydell [this message]
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=CAFEAcA8EkLUSyF0aEBuB5udPoxRxLwd8wJN4wDJRua5Vyb5cRA@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=barsamin@gmail.com \
--cc=paul@codesourcery.com \
--cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).