All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	qemu-trivial@nongnu.org,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"Greg Kurz" <groug@kaod.org>, "Cédric Le Goater" <clg@kaod.org>,
	"Bernhard Beschow" <shentey@gmail.com>
Subject: [PATCH 5/6] hw/ppc/e500: Resolve variable shadowing
Date: Fri, 16 Dec 2022 15:57:08 +0100	[thread overview]
Message-ID: <20221216145709.271940-6-shentey@gmail.com> (raw)
In-Reply-To: <20221216145709.271940-1-shentey@gmail.com>

Assign to the outer variable instead which even saves some code.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/ppc/e500.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index ad83924004..104a85ad22 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -883,7 +883,7 @@ void ppce500_init(MachineState *machine)
     bool kernel_as_payload;
     hwaddr bios_entry = 0;
     target_long payload_size;
-    struct boot_info *boot_info;
+    struct boot_info *boot_info = NULL;
     int dt_size;
     int i;
     unsigned int smp_cpus = machine->smp.cpus;
@@ -938,7 +938,6 @@ void ppce500_init(MachineState *machine)
         /* Register reset handler */
         if (!i) {
             /* Primary CPU */
-            struct boot_info *boot_info;
             boot_info = g_new0(struct boot_info, 1);
             qemu_register_reset(ppce500_cpu_reset, cpu);
             env->load_info = boot_info;
@@ -1217,7 +1216,6 @@ void ppce500_init(MachineState *machine)
     }
     assert(dt_size < DTB_MAX_SIZE);
 
-    boot_info = env->load_info;
     boot_info->entry = bios_entry;
     boot_info->dt_base = dt_base;
     boot_info->dt_size = dt_size;
-- 
2.39.0



  parent reply	other threads:[~2022-12-16 14:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 14:57 [PATCH 0/6] Trivial PPC cleanups Bernhard Beschow
2022-12-16 14:57 ` [PATCH 1/6] target/ppc/mmu_common: Log which effective address had no TLB entry found Bernhard Beschow
2022-12-16 16:24   ` Philippe Mathieu-Daudé
2022-12-16 14:57 ` [PATCH 2/6] target/ppc/mmu_common: Fix table layout of "info tlb" HMP command Bernhard Beschow
2022-12-16 16:24   ` Philippe Mathieu-Daudé
2022-12-16 14:57 ` [PATCH 3/6] hw/ppc/virtex_ml507: Prefer local over global variable Bernhard Beschow
2022-12-16 15:54   ` Edgar E. Iglesias
2022-12-16 16:28   ` Philippe Mathieu-Daudé
2022-12-16 14:57 ` [PATCH 4/6] hw/ppc/e500: Prefer local variable over qdev_get_machine() Bernhard Beschow
2022-12-16 15:06   ` BALATON Zoltan
2022-12-16 16:30   ` Philippe Mathieu-Daudé
2022-12-16 14:57 ` Bernhard Beschow [this message]
2022-12-16 14:57 ` [PATCH 6/6] hw/ppc/e500: Move comment to more appropriate place Bernhard Beschow
2022-12-16 15:32 ` [PATCH 0/6] Trivial PPC cleanups Cédric Le Goater
2022-12-16 16:04   ` Bernhard Beschow
2022-12-16 17:50 ` Daniel Henrique Barboza
2022-12-20 22:40   ` Bernhard Beschow
2022-12-20 22:53     ` Bernhard Beschow
2022-12-21 10:27       ` Daniel Henrique Barboza
2022-12-21 17:04         ` Bernhard Beschow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221216145709.271940-6-shentey@gmail.com \
    --to=shentey@gmail.com \
    --cc=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=edgar.iglesias@gmail.com \
    --cc=groug@kaod.org \
    --cc=laurent@vivier.eu \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.