On Tue, Apr 15, 2025 at 8:43 PM Jamin Lin <jamin_...@aspeedtech.com> wrote: > > The variable "sram_name" was only used for naming the SRAM memory region. > Rename it to "name" for consistency with similar code and avoid unnecessary > new local variable declarations. > > Signed-off-by: Jamin Lin <jamin_...@aspeedtech.com> > Reviewed-by: Cédric Le Goater <c...@redhat.com> Tested-by: Nabih Estefan <nabiheste...@google.com>
> --- > hw/arm/aspeed_ast27x0.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c > index dce7255a2c..b05ed75ff4 100644 > --- a/hw/arm/aspeed_ast27x0.c > +++ b/hw/arm/aspeed_ast27x0.c > @@ -577,7 +577,7 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, > Error **errp) > AspeedSoCClass *sc = ASPEED_SOC_GET_CLASS(s); > AspeedINTCClass *ic = ASPEED_INTC_GET_CLASS(&a->intc[0]); > AspeedINTCClass *icio = ASPEED_INTC_GET_CLASS(&a->intc[1]); > - g_autofree char *sram_name = NULL; > + g_autofree char *name = NULL; > qemu_irq irq; > > /* Default boot region (SPI memory or ROMs) */ > @@ -649,9 +649,9 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, > Error **errp) > } > > /* SRAM */ > - sram_name = g_strdup_printf("aspeed.sram.%d", > CPU(&a->cpu[0])->cpu_index); > - if (!memory_region_init_ram(&s->sram, OBJECT(s), sram_name, > sc->sram_size, > - errp)) { > + name = g_strdup_printf("aspeed.sram.%d", CPU(&a->cpu[0])->cpu_index); > + if (!memory_region_init_ram(&s->sram, OBJECT(s), name, sc->sram_size, > + errp)) { > return; > } > memory_region_add_subregion(s->memory, > -- > 2.43.0 >