[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 12/19] mac_nvram: Use NVRAM_SIZE constant
From: |
BALATON Zoltan |
Subject: |
[PATCH v6 12/19] mac_nvram: Use NVRAM_SIZE constant |
Date: |
Fri, 28 Oct 2022 13:56:28 +0200 (CEST) |
The NVRAM_SIZE constant was defined but not used. Rename it to
MACIO_NVRAM_SIZE to match the device model and use it where appropriate.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/misc/macio/macio.c | 2 +-
hw/ppc/mac_newworld.c | 4 ++--
include/hw/nvram/mac_nvram.h | 3 +--
3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index 93a7c7bbc8..08dbdd7fc0 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -226,7 +226,7 @@ static void macio_oldworld_init(Object *obj)
object_initialize_child(OBJECT(s), "nvram", &os->nvram, TYPE_MACIO_NVRAM);
dev = DEVICE(&os->nvram);
- qdev_prop_set_uint32(dev, "size", 0x2000);
+ qdev_prop_set_uint32(dev, "size", MACIO_NVRAM_SIZE);
qdev_prop_set_uint32(dev, "it_shift", 4);
for (i = 0; i < 2; i++) {
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index eb597bbe20..6b2d781dea 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -450,12 +450,12 @@ static void ppc_core99_init(MachineState *machine)
nvram_addr = 0xFFE00000;
}
dev = qdev_new(TYPE_MACIO_NVRAM);
- qdev_prop_set_uint32(dev, "size", 0x2000);
+ qdev_prop_set_uint32(dev, "size", MACIO_NVRAM_SIZE);
qdev_prop_set_uint32(dev, "it_shift", 1);
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, nvram_addr);
nvr = MACIO_NVRAM(dev);
- pmac_format_nvram_partition(nvr, 0x2000);
+ pmac_format_nvram_partition(nvr, MACIO_NVRAM_SIZE);
/* No PCI init: the BIOS will do it */
dev = qdev_new(TYPE_FW_CFG_MEM);
diff --git a/include/hw/nvram/mac_nvram.h b/include/hw/nvram/mac_nvram.h
index baa9f6a5a6..b780aca470 100644
--- a/include/hw/nvram/mac_nvram.h
+++ b/include/hw/nvram/mac_nvram.h
@@ -29,9 +29,8 @@
#include "exec/memory.h"
#include "hw/sysbus.h"
-#define NVRAM_SIZE 0x2000
+#define MACIO_NVRAM_SIZE 0x2000
-/* Mac NVRAM */
#define TYPE_MACIO_NVRAM "macio-nvram"
OBJECT_DECLARE_SIMPLE_TYPE(MacIONVRAMState, MACIO_NVRAM)
--
2.30.6
- [PATCH v6 02/19] mac_oldworld: Drop some more variables, (continued)
- [PATCH v6 02/19] mac_oldworld: Drop some more variables, BALATON Zoltan, 2022/10/28
- [PATCH v6 04/19] mac_{old|new}world: Avoid else branch by setting default value, BALATON Zoltan, 2022/10/28
- [PATCH v6 06/19] mac_{old|new}world: Reduce number of QOM casts, BALATON Zoltan, 2022/10/28
- [PATCH v6 05/19] mac_newworld: Clean up creation of Uninorth devices, BALATON Zoltan, 2022/10/28
- [PATCH v6 14/19] mac_newworld: Turn CORE99_VIA_CONFIG defines into an enum, BALATON Zoltan, 2022/10/28
- [PATCH v6 16/19] mac_newworld: Deprecate mac99 with G5 CPU, BALATON Zoltan, 2022/10/28
- [PATCH v6 18/19] mac_newworld: Document deprecation, BALATON Zoltan, 2022/10/28
- [PATCH v6 09/19] hw/ppc/mac.h: Move grackle-pcihost type declaration out to a header, BALATON Zoltan, 2022/10/28
- [PATCH v6 12/19] mac_nvram: Use NVRAM_SIZE constant,
BALATON Zoltan <=
- [PATCH v6 10/19] hw/ppc/mac.h: Move PROM and KERNEL defines to board code, BALATON Zoltan, 2022/10/28
- [PATCH v6 15/19] mac_newworld: Add machine types for different mac99 configs, BALATON Zoltan, 2022/10/28
- [PATCH v6 19/19] mac_{old, new}world: Pass MacOS VGA NDRV in card ROM instead of fw_cfg, BALATON Zoltan, 2022/10/28
- [PATCH v6 17/19] mac_newworld: Deprecate mac99 "via" option, BALATON Zoltan, 2022/10/28
- [PATCH v6 07/19] hw/ppc/mac.h: Move newworld specific parts out from shared header, BALATON Zoltan, 2022/10/28
- [PATCH v6 11/19] hw/ppc/mac.h: Rename to include/hw/nvram/mac_nvram.h, BALATON Zoltan, 2022/10/28
- [PATCH v6 13/19] mac_{old|new}world: Code style fix adding missing braces to if-s, BALATON Zoltan, 2022/10/28
- [PATCH v6 08/19] hw/ppc/mac.h: Move macio specific parts out from shared header, BALATON Zoltan, 2022/10/28
- Re: [PATCH v6 00/19] Misc ppc/mac machines clean up, Mark Cave-Ayland, 2022/10/30