[PATCH] hw/mips: loongson3: Drop 'struct MemmapEntry'

Bin Meng posted 1 patch 3 years, 3 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210122122404.11970-1-bmeng.cn@gmail.com
Maintainers: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Huacai Chen <chenhuacai@kernel.org>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aurelien Jarno <aurelien@aurel32.net>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>
hw/mips/loongson3_bootp.h | 7 +------
hw/mips/loongson3_virt.c  | 6 +++---
2 files changed, 4 insertions(+), 9 deletions(-)
[PATCH] hw/mips: loongson3: Drop 'struct MemmapEntry'
Posted by Bin Meng 3 years, 3 months ago
From: Bin Meng <bin.meng@windriver.com>

There is already a MemMapEntry type defined in hwaddr.h. Let's drop
the loongson3 defined `struct MemmapEntry` and use the existing one.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
---

 hw/mips/loongson3_bootp.h | 7 +------
 hw/mips/loongson3_virt.c  | 6 +++---
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/hw/mips/loongson3_bootp.h b/hw/mips/loongson3_bootp.h
index 09f8480abf..d525ab745a 100644
--- a/hw/mips/loongson3_bootp.h
+++ b/hw/mips/loongson3_bootp.h
@@ -228,12 +228,7 @@ enum {
     LOADER_PARAM,
 };
 
-struct MemmapEntry {
-    hwaddr base;
-    hwaddr size;
-};
-
-extern const struct MemmapEntry virt_memmap[];
+extern const MemMapEntry virt_memmap[];
 void init_loongson_params(struct loongson_params *lp, void *p,
                           uint64_t cpu_freq, uint64_t ram_size);
 void init_reset_system(struct efi_reset_system_t *reset);
diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c
index d4a82fa536..b15071defc 100644
--- a/hw/mips/loongson3_virt.c
+++ b/hw/mips/loongson3_virt.c
@@ -72,7 +72,7 @@
 #define RTC_IRQ             1
 #define PCIE_IRQ_BASE       2
 
-const struct MemmapEntry virt_memmap[] = {
+const MemMapEntry virt_memmap[] = {
     [VIRT_LOWMEM] =      { 0x00000000,    0x10000000 },
     [VIRT_PM] =          { 0x10080000,         0x100 },
     [VIRT_FW_CFG] =      { 0x10080100,         0x100 },
@@ -86,13 +86,13 @@ const struct MemmapEntry virt_memmap[] = {
     [VIRT_HIGHMEM] =     { 0x80000000,           0x0 }, /* Variable */
 };
 
-static const struct MemmapEntry loader_memmap[] = {
+static const MemMapEntry loader_memmap[] = {
     [LOADER_KERNEL] =    { 0x00000000,     0x4000000 },
     [LOADER_INITRD] =    { 0x04000000,           0x0 }, /* Variable */
     [LOADER_CMDLINE] =   { 0x0ff00000,      0x100000 },
 };
 
-static const struct MemmapEntry loader_rommap[] = {
+static const MemMapEntry loader_rommap[] = {
     [LOADER_BOOTROM] =   { 0x1fc00000,        0x1000 },
     [LOADER_PARAM] =     { 0x1fc01000,       0x10000 },
 };
-- 
2.25.1


Re: [PATCH] hw/mips: loongson3: Drop 'struct MemmapEntry'
Posted by Philippe Mathieu-Daudé 3 years, 3 months ago
On 1/22/21 1:24 PM, Bin Meng wrote:
> From: Bin Meng <bin.meng@windriver.com>
> 
> There is already a MemMapEntry type defined in hwaddr.h. Let's drop
> the loongson3 defined `struct MemmapEntry` and use the existing one.
> 
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> ---
> 
>  hw/mips/loongson3_bootp.h | 7 +------
>  hw/mips/loongson3_virt.c  | 6 +++---
>  2 files changed, 4 insertions(+), 9 deletions(-)

Thanks, applied to mips-next.

Re: [PATCH] hw/mips: loongson3: Drop 'struct MemmapEntry'
Posted by Philippe Mathieu-Daudé 3 years, 3 months ago
On 1/22/21 1:24 PM, Bin Meng wrote:
> From: Bin Meng <bin.meng@windriver.com>
> 
> There is already a MemMapEntry type defined in hwaddr.h. Let's drop
> the loongson3 defined `struct MemmapEntry` and use the existing one.

Not really... based on 0e324626306:

$ git grep MemmapEntry origin/master -- include
$

What tree are you using?

Thanks,

Phil.

Re: [PATCH] hw/mips: loongson3: Drop 'struct MemmapEntry'
Posted by Bin Meng 3 years, 3 months ago
On Fri, Jan 22, 2021 at 9:37 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> On 1/22/21 1:24 PM, Bin Meng wrote:
> > From: Bin Meng <bin.meng@windriver.com>
> >
> > There is already a MemMapEntry type defined in hwaddr.h. Let's drop
> > the loongson3 defined `struct MemmapEntry` and use the existing one.
>
> Not really... based on 0e324626306:
>
> $ git grep MemmapEntry origin/master -- include
> $
>
> What tree are you using?

The latest origin/master

Use $ git grep MemmapEntry origin/master --

It's not defined in include.

Regards,
Bin

Re: [PATCH] hw/mips: loongson3: Drop 'struct MemmapEntry'
Posted by Philippe Mathieu-Daudé 3 years, 3 months ago
On 1/22/21 2:37 PM, Philippe Mathieu-Daudé wrote:
> On 1/22/21 1:24 PM, Bin Meng wrote:
>> From: Bin Meng <bin.meng@windriver.com>
>>
>> There is already a MemMapEntry type defined in hwaddr.h. Let's drop
>> the loongson3 defined `struct MemmapEntry` and use the existing one.
> 
> Not really... based on 0e324626306:
> 
> $ git grep MemmapEntry origin/master -- include
> $

OK I understood, you replaced MemmapEntry by MemMapEntry which
is written slightly differently.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Thanks!