qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v6 1/2] Implement .hex file loader


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v6 1/2] Implement .hex file loader
Date: Wed, 9 May 2018 14:24:23 +0100

On Mon, May 7, 2018 at 10:27 AM, Su Hang <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]