qemu-ppc
[Top][All Lists]
Advanced

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

Re: [PATCH v6 14/19] mac_newworld: Turn CORE99_VIA_CONFIG defines into a


From: Mark Cave-Ayland
Subject: Re: [PATCH v6 14/19] mac_newworld: Turn CORE99_VIA_CONFIG defines into an enum
Date: Sat, 29 Oct 2022 09:49:19 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

On 28/10/2022 12:56, BALATON Zoltan wrote:

This might allow the compiler to check values.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
  hw/ppc/mac_newworld.c | 10 ++++++----
  1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 37123daa6b..601ea518f8 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -95,15 +95,17 @@ typedef struct Core99MachineState Core99MachineState;
  DECLARE_INSTANCE_CHECKER(Core99MachineState, CORE99_MACHINE,
                           TYPE_CORE99_MACHINE)
-#define CORE99_VIA_CONFIG_CUDA 0x0
-#define CORE99_VIA_CONFIG_PMU      0x1
-#define CORE99_VIA_CONFIG_PMU_ADB  0x2
+typedef enum {
+    CORE99_VIA_CONFIG_CUDA = 0,
+    CORE99_VIA_CONFIG_PMU,
+    CORE99_VIA_CONFIG_PMU_ADB
+} Core99ViaConfig;
struct Core99MachineState {
      /*< private >*/
      MachineState parent;
- uint8_t via_config;
+    Core99ViaConfig via_config;
  };
static void fw_cfg_boot_set(void *opaque, const char *boot_device,

Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


ATB,

Mark.



reply via email to

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