qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: BALATON Zoltan <balaton@eik.bme.hu>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Magnus Damm <magnus.damm@gmail.com>,
	qemu-ppc@nongnu.org
Subject: Re: [PATCH 4/5] hw/sh4/r2d: Use the IEC binary prefix definitions
Date: Mon, 9 Jan 2023 14:12:19 +0100	[thread overview]
Message-ID: <0bd1f61c-757c-1468-e8ff-7730c94d3beb@linaro.org> (raw)
In-Reply-To: <31e6a45c-3fec-f6ae-875f-b1a8ac8749e0@eik.bme.hu>

On 9/1/23 13:46, BALATON Zoltan wrote:
> On Mon, 9 Jan 2023, Philippe Mathieu-Daudé wrote:
>> IEC binary prefixes ease code review: the unit is explicit.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> hw/sh4/r2d.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c
>> index 39fc4f19d9..b3667e9b12 100644
>> --- a/hw/sh4/r2d.c
>> +++ b/hw/sh4/r2d.c
>> @@ -47,10 +47,10 @@
>> #define FLASH_BASE 0x00000000
>> #define FLASH_SIZE (16 * MiB)
>>
>> -#define SDRAM_BASE 0x0c000000 /* Physical location of SDRAM: Area 3 */
>> -#define SDRAM_SIZE 0x04000000
>> +#define SDRAM_BASE          (192 * MiB) /* Physical location of 
>> SDRAM: Area 3 */
>> +#define SDRAM_SIZE          (64 * MiB)
> 
> I don't think changing these help as the docs probably have memory map 
> with the hex numbers rather than sizes so it's easier to match as it is 
> now.
> 
>> -#define SM501_VRAM_SIZE 0x800000
>> +#define SM501_VRAM_SIZE     (8 * MiB)
> 
> This one is OK but since it's only used once in
> 
> qdev_prop_set_uint32(dev, "vram-size", SM501_VRAM_SIZE);
> 
> you might as well just inline it there and remove the define which is 
> then pretty clear and easier to see without needing to look up the 
> define far away from its usage.

I did this change after Peter's feedbacks on:
https://lore.kernel.org/qemu-devel/CAFEAcA8MSO4YMEq2FqvpJKUVYE_1CqaB2KLD1YN-YebOhJVgEg@mail.gmail.com/

But maybe I misunderstood him. Peter, looking at it again, maybe you
asked for a definition because when using pflash_cfi01_register() it
isn't explicit what means each argument? So in this case, since the
properties gives a hint on what is the value ("vram-size") it would
be OK to inline?

Thanks,

Phil.


  reply	other threads:[~2023-01-09 13:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 12:01 [PATCH 0/5] hw: Cleanups around PFLASH use Philippe Mathieu-Daudé
2023-01-09 12:01 ` [PATCH 1/5] hw/ppc/sam460ex: Remove unreachable code calling pflash_cfi01_register() Philippe Mathieu-Daudé
2023-01-09 12:38   ` BALATON Zoltan
2023-01-09 16:42   ` Bernhard Beschow
2023-01-09 16:51     ` Philippe Mathieu-Daudé
2023-01-09 12:01 ` [PATCH 2/5] hw/microblaze/petalogix: Add FLASH_SECTOR_SIZE definitions Philippe Mathieu-Daudé
2023-01-09 12:01 ` [PATCH 3/5] hw/mips/malta: Add the FLASH_SECTOR_SIZE definition Philippe Mathieu-Daudé
2023-01-09 12:01 ` [PATCH 4/5] hw/sh4/r2d: Use the IEC binary prefix definitions Philippe Mathieu-Daudé
2023-01-09 12:46   ` BALATON Zoltan
2023-01-09 13:12     ` Philippe Mathieu-Daudé [this message]
2023-01-09 14:02       ` BALATON Zoltan
2023-01-09 12:01 ` [PATCH 5/5] hw/sh4/r2d: Add the FLASH_SECTOR_SIZE definition Philippe Mathieu-Daudé
2023-01-09 12:49   ` BALATON Zoltan

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=0bd1f61c-757c-1468-e8ff-7730c94d3beb@linaro.org \
    --to=philmd@linaro.org \
    --cc=aurelien@aurel32.net \
    --cc=balaton@eik.bme.hu \
    --cc=edgar.iglesias@gmail.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=magnus.damm@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=ysato@users.sourceforge.jp \
    /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).