All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Su Hang <suhang16@mails.ucas.ac.cn>
Cc: Jim Mussared <jim@groklearning.com>,
	Joel Stanley <joel@jms.id.au>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v6 1/2] Implement .hex file loader
Date: Wed, 9 May 2018 14:24:23 +0100	[thread overview]
Message-ID: <CAJSP0QUrtMb7bcv00Q124UkbcuHat=Ljwm82tsXp41PxyVoVxA@mail.gmail.com> (raw)
In-Reply-To: <4af4c034.10f40.16339ed38a1.Coremail.suhang16@mails.ucas.ac.cn>

On Mon, May 7, 2018 at 10:27 AM, Su Hang <suhang16@mails.ucas.ac.cn> wrote:
>> > +    size_t total_size = 0;
>>
>> Please use int instead of size_t (see above for reasons).
> I have question here:
> Since `EXT_LINEAR_ADDR_RECORD` supports 32 bit addressing (up to 4GiB), is `int`
> big enough for this type?
> The same question will happen to other similar cases.
> Or should I use `long long` instead of `int`?

There is no way of fixing that without modifying hw/arm/boot.c to use
a different type for kernel_size.  It looks like the actual size is
never used in that file.  A bool would be enough to indicate whether
loading the kernel succeeded.

Then the Intel .hex file parser code could be adjusted to either just
return bool or to use an appropriate type as you suggested.

Stefan

  reply	other threads:[~2018-05-09 13:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-26 13:51 [Qemu-devel] [PATCH v6 0/2] Implement Hex file loader and add test case Su Hang
2018-04-26 13:51 ` [Qemu-devel] [PATCH v6 1/2] Implement .hex file loader Su Hang
2018-04-30 14:23   ` Stefan Hajnoczi
2018-04-30 15:40     ` Su Hang
2018-05-07  9:27     ` Su Hang
2018-05-09 13:24       ` Stefan Hajnoczi [this message]
2018-04-26 13:51 ` [Qemu-devel] [PATCH v6 2/2] Add QTest testcase for the Intel Hexadecimal Object File Loader Su Hang

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='CAJSP0QUrtMb7bcv00Q124UkbcuHat=Ljwm82tsXp41PxyVoVxA@mail.gmail.com' \
    --to=stefanha@gmail.com \
    --cc=jim@groklearning.com \
    --cc=joel@jms.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=suhang16@mails.ucas.ac.cn \
    /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.