Message ID | 20230206085007.3618715-1-bmeng@tinylab.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | hw/riscv: virt: Simplify virt_{get,set}_aclint() | expand |
On 6/2/23 09:50, Bin Meng wrote: > There is no need to declare an intermediate "MachineState *ms". > > Signed-off-by: Bin Meng <bmeng@tinylab.org> > --- > > hw/riscv/virt.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
On Mon, Feb 6, 2023 at 6:51 PM Bin Meng <bmeng@tinylab.org> wrote: > > There is no need to declare an intermediate "MachineState *ms". > > Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Alistair > --- > > hw/riscv/virt.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c > index 4a11b4b010..bdb6b93115 100644 > --- a/hw/riscv/virt.c > +++ b/hw/riscv/virt.c > @@ -1577,16 +1577,14 @@ static void virt_set_aia(Object *obj, const char *val, Error **errp) > > static bool virt_get_aclint(Object *obj, Error **errp) > { > - MachineState *ms = MACHINE(obj); > - RISCVVirtState *s = RISCV_VIRT_MACHINE(ms); > + RISCVVirtState *s = RISCV_VIRT_MACHINE(obj); > > return s->have_aclint; > } > > static void virt_set_aclint(Object *obj, bool value, Error **errp) > { > - MachineState *ms = MACHINE(obj); > - RISCVVirtState *s = RISCV_VIRT_MACHINE(ms); > + RISCVVirtState *s = RISCV_VIRT_MACHINE(obj); > > s->have_aclint = value; > } > -- > 2.25.1 > >
On Mon, Feb 6, 2023 at 6:51 PM Bin Meng <bmeng@tinylab.org> wrote: > > There is no need to declare an intermediate "MachineState *ms". > > Signed-off-by: Bin Meng <bmeng@tinylab.org> Thanks! Applied to riscv-to-apply.next Alistair > --- > > hw/riscv/virt.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c > index 4a11b4b010..bdb6b93115 100644 > --- a/hw/riscv/virt.c > +++ b/hw/riscv/virt.c > @@ -1577,16 +1577,14 @@ static void virt_set_aia(Object *obj, const char *val, Error **errp) > > static bool virt_get_aclint(Object *obj, Error **errp) > { > - MachineState *ms = MACHINE(obj); > - RISCVVirtState *s = RISCV_VIRT_MACHINE(ms); > + RISCVVirtState *s = RISCV_VIRT_MACHINE(obj); > > return s->have_aclint; > } > > static void virt_set_aclint(Object *obj, bool value, Error **errp) > { > - MachineState *ms = MACHINE(obj); > - RISCVVirtState *s = RISCV_VIRT_MACHINE(ms); > + RISCVVirtState *s = RISCV_VIRT_MACHINE(obj); > > s->have_aclint = value; > } > -- > 2.25.1 > >
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 4a11b4b010..bdb6b93115 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1577,16 +1577,14 @@ static void virt_set_aia(Object *obj, const char *val, Error **errp) static bool virt_get_aclint(Object *obj, Error **errp) { - MachineState *ms = MACHINE(obj); - RISCVVirtState *s = RISCV_VIRT_MACHINE(ms); + RISCVVirtState *s = RISCV_VIRT_MACHINE(obj); return s->have_aclint; } static void virt_set_aclint(Object *obj, bool value, Error **errp) { - MachineState *ms = MACHINE(obj); - RISCVVirtState *s = RISCV_VIRT_MACHINE(ms); + RISCVVirtState *s = RISCV_VIRT_MACHINE(obj); s->have_aclint = value; }
There is no need to declare an intermediate "MachineState *ms". Signed-off-by: Bin Meng <bmeng@tinylab.org> --- hw/riscv/virt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)