qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Maxim Uvarov <maxim.uvarov@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Shashi Mallela" <shashi.mallela@linaro.org>,
	"Leif Lindholm" <leif@nuviainc.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	qemu-arm <qemu-arm@nongnu.org>,
	"Radosław Biernacki" <rad@semihalf.com>
Subject: Re: [PATCH v3 1/2] hw/watchdog: Implement SBSA watchdog device
Date: Fri, 9 Oct 2020 12:35:14 +0300	[thread overview]
Message-ID: <CAD8XO3bNhRpsHF40KLWJNayL-FoX3vSyubAyUUPC++Btpdt6QQ@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA__EG5Ou9W0H24oEKFA9Ft11n6pjcSwD-ZG4Bir8=3Xhw@mail.gmail.com>

On Thu, 8 Oct 2020 at 17:09, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Thu, 8 Oct 2020 at 11:43, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> >
> > On Thu, 8 Oct 2020 at 13:27, Peter Maydell <peter.maydell@linaro.org> wrote:
> > >
> > > On Thu, 8 Oct 2020 at 11:21, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> > > > Interesting why gcc does not warn on  64bit signed to 32bit unsigned
> > > > truncation here. Looks like it's too smart to understand
> > > > that value fits in 32 bits.
> > >
> > > What truncation? 1000000000 in decimal is 0x3B9ACA00 in hex:
> > > the number fits in an 32 bit integer without truncation.
>
> > I meant that LL is an long long int which is 64 bit size type. And
> > then you pass it to uint32_t.
>
> Yes, that's fine, because it fits. The LL ensures that if
> you do a calculation like:
>  uint64_t max_timeout = 16 * NANOSECONDS_PER_SECOND;
> it isn't incorrectly done as 32-bit arithmetic.
>
> thanks
> -- PMM

Ok. Thanks.


  reply	other threads:[~2020-10-09  9:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-08  2:42 [PATCH v3 0/2] Add watchdog support for SbsaQemu Shashi Mallela
2020-10-08  2:42 ` [PATCH v3 1/2] hw/watchdog: Implement SBSA watchdog device Shashi Mallela
2020-10-08 10:21   ` Maxim Uvarov
2020-10-08 10:27     ` Peter Maydell
2020-10-08 10:43       ` Maxim Uvarov
2020-10-08 14:08         ` Peter Maydell
2020-10-09  9:35           ` Maxim Uvarov [this message]
2020-10-08  2:42 ` [PATCH v3 2/2] hw/arm/sbsa-ref: add " Shashi Mallela
2020-10-08  9:29   ` Maxim Uvarov

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=CAD8XO3bNhRpsHF40KLWJNayL-FoX3vSyubAyUUPC++Btpdt6QQ@mail.gmail.com \
    --to=maxim.uvarov@linaro.org \
    --cc=leif@nuviainc.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rad@semihalf.com \
    --cc=shashi.mallela@linaro.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).