[Qemu-devel] [PATCH v18 04/29] !fixup target/rx: CPU definition

Philippe Mathieu-Daudé posted 29 patches 6 years, 8 months ago
Maintainers: Alistair Francis <alistair@alistair23.me>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Markus Armbruster <armbru@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Thomas Huth <thuth@redhat.com>, Eric Blake <eblake@redhat.com>, Laurent Vivier <lvivier@redhat.com>
There is a newer version of this series
[Qemu-devel] [PATCH v18 04/29] !fixup target/rx: CPU definition
Posted by Philippe Mathieu-Daudé 6 years, 8 months ago
Rename macros.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 target/rx/cpu.c | 22 ++++++++++++++--------
 target/rx/cpu.h | 12 ++++++------
 2 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/target/rx/cpu.c b/target/rx/cpu.c
index 4b96f2e463..3c43467534 100644
--- a/target/rx/cpu.c
+++ b/target/rx/cpu.c
@@ -153,7 +153,7 @@ static void rx_cpu_init(Object *obj)
     qdev_init_gpio_in(DEVICE(cpu), rx_cpu_set_irq, 2);
 }
 
-static void rxcpu_class_init(ObjectClass *klass, void *data)
+static void rx_cpu_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
     CPUClass *cc = CPU_CLASS(klass);
@@ -181,22 +181,28 @@ static void rxcpu_class_init(ObjectClass *klass, void *data)
     cc->gdb_num_core_regs = 26;
 }
 
-static const TypeInfo rxcpu_info = {
-    .name = TYPE_RXCPU,
+static const TypeInfo rx_cpu_info = {
+    .name = TYPE_RX_CPU,
     .parent = TYPE_CPU,
     .instance_size = sizeof(RXCPU),
     .instance_init = rx_cpu_init,
-    .abstract = false,
+    .abstract = true,
     .class_size = sizeof(RXCPUClass),
-    .class_init = rxcpu_class_init,
+    .class_init = rx_cpu_class_init,
 };
 
-static void rxcpu_register_types(void)
+static const TypeInfo rx62n_rx_cpu_info = {
+    .name = RX_CPU_TYPE_NAME("rx62n"),
+    .parent = TYPE_RX_CPU,
+};
+
+static void rx_cpu_register_types(void)
 {
-    type_register_static(&rxcpu_info);
+    type_register_static(&rx_cpu_info);
+    type_register_static(&rx62n_rx_cpu_info);
 }
 
-type_init(rxcpu_register_types)
+type_init(rx_cpu_register_types)
 
 static uint32_t extable[32];
 
diff --git a/target/rx/cpu.h b/target/rx/cpu.h
index 8c1a4e448d..a0b6975963 100644
--- a/target/rx/cpu.h
+++ b/target/rx/cpu.h
@@ -24,14 +24,14 @@
 #include "hw/registerfields.h"
 #include "qom/cpu.h"
 
-#define TYPE_RXCPU "rxcpu"
+#define TYPE_RX_CPU "rx-cpu"
 
 #define RXCPU_CLASS(klass)                                     \
-    OBJECT_CLASS_CHECK(RXCPUClass, (klass), TYPE_RXCPU)
+    OBJECT_CLASS_CHECK(RXCPUClass, (klass), TYPE_RX_CPU)
 #define RXCPU(obj) \
-    OBJECT_CHECK(RXCPU, (obj), TYPE_RXCPU)
+    OBJECT_CHECK(RXCPU, (obj), TYPE_RX_CPU)
 #define RXCPU_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(RXCPUClass, (obj), TYPE_RXCPU)
+    OBJECT_GET_CLASS(RXCPUClass, (obj), TYPE_RX_CPU)
 
 /*
  * RXCPUClass:
@@ -164,9 +164,9 @@ static inline RXCPU *rx_env_get_cpu(CPURXState *env)
 
 #define ENV_OFFSET offsetof(RXCPU, env)
 
-#define RX_CPU_TYPE_SUFFIX "-" TYPE_RXCPU
+#define RX_CPU_TYPE_SUFFIX "-" TYPE_RX_CPU
 #define RX_CPU_TYPE_NAME(model) model RX_CPU_TYPE_SUFFIX
-#define CPU_RESOLVING_TYPE TYPE_RXCPU
+#define CPU_RESOLVING_TYPE TYPE_RX_CPU
 
 extern const char rx_crname[][6];
 
-- 
2.20.1


Re: [Qemu-devel] [PATCH v18 04/29] !fixup target/rx: CPU definition
Posted by Eric Blake 6 years, 8 months ago
On 6/7/19 10:37 AM, Philippe Mathieu-Daudé wrote:
> Rename macros.

Why is this marked '!fixup' in the subject instead of just merging the
patches directly?

> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  target/rx/cpu.c | 22 ++++++++++++++--------
>  target/rx/cpu.h | 12 ++++++------
>  2 files changed, 20 insertions(+), 14 deletions(-)
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Re: [Qemu-devel] [PATCH v18 04/29] !fixup target/rx: CPU definition
Posted by Philippe Mathieu-Daudé 6 years, 8 months ago
On 6/7/19 8:02 PM, Eric Blake wrote:
> On 6/7/19 10:37 AM, Philippe Mathieu-Daudé wrote:
>> Rename macros.
> 
> Why is this marked '!fixup' in the subject instead of just merging the
> patches directly?

Since all the series is reviewed/tested and Igor asked to amend a fixup
but we are having hard time to figure if we understand Igor request
correctly, I thought it would be easier for him to review this way, then
for Richard to squash the patches and send the pull request.

Is it confuse/bad practice?

In the cover I wrote:

  If Igor aggrees with the fixup patches, Richard, can you squash
  them and send a pull request?  (without the last patch, which is
  expected to go via Eduardo's tree, but since it is helpful for
  testing this series, I included it).

>>
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>  target/rx/cpu.c | 22 ++++++++++++++--------
>>  target/rx/cpu.h | 12 ++++++------
>>  2 files changed, 20 insertions(+), 14 deletions(-)
>>

Re: [Qemu-devel] [PATCH v18 04/29] !fixup target/rx: CPU definition
Posted by Igor Mammedov 6 years, 8 months ago
On Fri, 7 Jun 2019 20:06:12 +0200
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:

> On 6/7/19 8:02 PM, Eric Blake wrote:
> > On 6/7/19 10:37 AM, Philippe Mathieu-Daudé wrote:  
> >> Rename macros.  
> > 
> > Why is this marked '!fixup' in the subject instead of just merging the
> > patches directly?  
> 
> Since all the series is reviewed/tested and Igor asked to amend a fixup
> but we are having hard time to figure if we understand Igor request
> correctly, I thought it would be easier for him to review this way, then
> for Richard to squash the patches and send the pull request.
I've explicitly asked for merging if I'm not mistaken.

 
> Is it confuse/bad practice?
it's confusing at least for me, since I have to review broken patch and fix ups
on top doing merge in my head and still won't be sure if I've missed
something in process on not.

(Fix ups are fine for trivial change that affect only one patch,
which isn't case here)

Please respin.

> 
> In the cover I wrote:
> 
>   If Igor aggrees with the fixup patches, Richard, can you squash
>   them and send a pull request?  (without the last patch, which is
>   expected to go via Eduardo's tree, but since it is helpful for
>   testing this series, I included it).
> 
> >>
> >> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> >> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> >> ---
> >>  target/rx/cpu.c | 22 ++++++++++++++--------
> >>  target/rx/cpu.h | 12 ++++++------
> >>  2 files changed, 20 insertions(+), 14 deletions(-)
> >>