qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hao Wu <wuhaotsh@google.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm <qemu-arm@nongnu.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Tyrone Ting" <kfting@nuvoton.com>, "Luc Michel" <luc@lmichel.fr>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Havard Skinnemoen" <hskinnemoen@google.com>
Subject: Re: [PATCH v2 4/4] hw/timer/npcm7xx_timer: Use new clock_ns_to_ticks()
Date: Wed, 10 Feb 2021 13:01:39 -0800	[thread overview]
Message-ID: <CAGcCb10GVgiY+cNAvbmuZTbP5W00gGm1F0cJ3oTFcPOiYRS+3w@mail.gmail.com> (raw)
In-Reply-To: <20210209132040.5091-5-peter.maydell@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1127 bytes --]

On Tue, Feb 9, 2021 at 5:21 AM Peter Maydell <peter.maydell@linaro.org>
wrote:

> Use the new clock_ns_to_ticks() function in npcm7xx_timer where
> appropriate.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>
Reviewed-by: Hao Wu <wuhaotsh@google.com>

Thanks!

> ---
>  hw/timer/npcm7xx_timer.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/timer/npcm7xx_timer.c b/hw/timer/npcm7xx_timer.c
> index 4efdf135b82..32f5e021f85 100644
> --- a/hw/timer/npcm7xx_timer.c
> +++ b/hw/timer/npcm7xx_timer.c
> @@ -138,8 +138,8 @@ static int64_t npcm7xx_timer_count_to_ns(NPCM7xxTimer
> *t, uint32_t count)
>  /* Convert a time interval in nanoseconds to a timer cycle count. */
>  static uint32_t npcm7xx_timer_ns_to_count(NPCM7xxTimer *t, int64_t ns)
>  {
> -    return ns / clock_ticks_to_ns(t->ctrl->clock,
> -                                  npcm7xx_tcsr_prescaler(t->tcsr));
> +    return clock_ns_to_ticks(t->ctrl->clock, ns) /
> +        npcm7xx_tcsr_prescaler(t->tcsr);
>  }
>
>  static uint32_t npcm7xx_watchdog_timer_prescaler(const
> NPCM7xxWatchdogTimer *t)
> --
> 2.20.1
>
>
>

[-- Attachment #2: Type: text/html, Size: 1851 bytes --]

  reply	other threads:[~2021-02-10 21:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 13:20 [PATCH v2 0/4] New APIs for the Clock framework Peter Maydell
2021-02-09 13:20 ` [PATCH v2 1/4] clock: Add ClockEvent parameter to callbacks Peter Maydell
2021-02-10 20:53   ` Hao Wu
2021-02-10 22:19     ` Peter Maydell
2021-02-11 10:14   ` Luc Michel
2021-02-11 15:29   ` Philippe Mathieu-Daudé
2021-02-09 13:20 ` [PATCH v2 2/4] clock: Add ClockPreUpdate callback event type Peter Maydell
2021-02-10 20:55   ` Hao Wu
2021-02-10 22:55   ` Philippe Mathieu-Daudé
2021-02-11 10:11   ` Luc Michel
2021-02-09 13:20 ` [PATCH v2 3/4] clock: Add clock_ns_to_ticks() function Peter Maydell
2021-02-10 21:00   ` Hao Wu
2021-02-10 23:44   ` Philippe Mathieu-Daudé
2021-02-11 10:13   ` Luc Michel
2021-02-09 13:20 ` [PATCH v2 4/4] hw/timer/npcm7xx_timer: Use new clock_ns_to_ticks() Peter Maydell
2021-02-10 21:01   ` Hao Wu [this message]
2021-02-10 23:44   ` Philippe Mathieu-Daudé
2021-02-11 10:13   ` Luc Michel

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=CAGcCb10GVgiY+cNAvbmuZTbP5W00gGm1F0cJ3oTFcPOiYRS+3w@mail.gmail.com \
    --to=wuhaotsh@google.com \
    --cc=f4bug@amsat.org \
    --cc=hskinnemoen@google.com \
    --cc=kfting@nuvoton.com \
    --cc=luc@lmichel.fr \
    --cc=peter.maydell@linaro.org \
    --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).