qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Francisco Iglesias <francisco.iglesias@xilinx.com>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org,
	 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Alistair Francis <alistair@alistair23.me>
Subject: Re: [PATCH] ptimer: Rename PTIMER_POLICY_DEFAULT to PTIMER_POLICY_LEGACY
Date: Mon, 16 May 2022 14:35:02 +0100	[thread overview]
Message-ID: <CAFEAcA94EpfKrgYjupzDacvVn+c45ao_fdYaDjMp7mCUbacN6A@mail.gmail.com> (raw)
In-Reply-To: <20220516131032.ykidzcfvjhxqmets@debian>

On Mon, 16 May 2022 at 14:10, Francisco Iglesias
<francisco.iglesias@xilinx.com> wrote:
>
> On Mon, May 16, 2022 at 11:30:58AM +0100, Peter Maydell wrote:
> > The traditional ptimer behaviour includes a collection of weird edge
> > case behaviours.  In 2016 we improved the ptimer implementation to
> > fix these and generally make the behaviour more flexible, with
> > ptimers opting in to the new behaviour by passing an appropriate set
> > of policy flags to ptimer_init().  For backwards-compatibility, we
> > defined PTIMER_POLICY_DEFAULT (which sets no flags) to give the old
> > weird behaviour.
> >
> > This turns out to be a poor choice of name, because people writing
> > new devices which use ptimers are misled into thinking that the
> > default is probably a sensible choice of flags, when in fact it is
> > almost always not what you want.  Rename PTIMER_POLICY_DEFAULT to
> > PTIMER_POLICY_LEGACY and beef up the comment to more clearly say that
> > new devices should not be using it.
> >
> > The code-change part of this commit was produced by
> >   sed -i -e 's/PTIMER_POLICY_DEFAULT/PTIMER_POLICY_LEGACY/g' $(git grep -l PTIMER_POLICY_DEFAULT)
> >
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


> > --- a/tests/unit/ptimer-test.c
> > +++ b/tests/unit/ptimer-test.c
> > @@ -768,7 +768,7 @@ static void add_ptimer_tests(uint8_t policy)
> >      char policy_name[256] = "";
> >      char *tmp;
> >
> > -    if (policy == PTIMER_POLICY_DEFAULT) {
> > +    if (policy == PTIMER_POLICY_LEGACY) {
> >          g_sprintf(policy_name, "default");
>
> Hi Peter,
>
> It might be that above is clearer after this patch with "legacy"

Oops, yes, we should adjust the test name string there too.

thanks
-- PMM


  reply	other threads:[~2022-05-16 13:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-16 10:30 [PATCH] ptimer: Rename PTIMER_POLICY_DEFAULT to PTIMER_POLICY_LEGACY Peter Maydell
2022-05-16 13:10 ` Francisco Iglesias
2022-05-16 13:35   ` Peter Maydell [this message]
2022-05-16 15:50 ` Richard Henderson

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=CAFEAcA94EpfKrgYjupzDacvVn+c45ao_fdYaDjMp7mCUbacN6A@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=alistair@alistair23.me \
    --cc=edgar.iglesias@gmail.com \
    --cc=francisco.iglesias@xilinx.com \
    --cc=qemu-arm@nongnu.org \
    --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).