Patchwork [4/6] ppc: Don't explode QEMUMachineInitArgs into local variables needlessly

login
register
mail settings
Submitter Markus Armbruster
Date June 14, 2013, 11:40 a.m.
Message ID <1371210042-15337-5-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/251383/
State New
Headers show

Comments

Markus Armbruster - June 14, 2013, 11:40 a.m.
Don't explode when the variable is used just once, and never changed.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/ppc/e500plat.c  | 18 ++++++------------
 hw/ppc/mpc8544ds.c | 18 ++++++------------
 2 files changed, 12 insertions(+), 24 deletions(-)

Patch

diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c
index c852995..a78de07 100644
--- a/hw/ppc/e500plat.c
+++ b/hw/ppc/e500plat.c
@@ -30,19 +30,13 @@  static void e500plat_fixup_devtree(PPCE500Params *params, void *fdt)
 
 static void e500plat_init(QEMUMachineInitArgs *args)
 {
-    ram_addr_t ram_size = args->ram_size;
-    const char *boot_device = args->boot_device;
-    const char *cpu_model = args->cpu_model;
-    const char *kernel_filename = args->kernel_filename;
-    const char *kernel_cmdline = args->kernel_cmdline;
-    const char *initrd_filename = args->initrd_filename;
     PPCE500Params params = {
-        .ram_size = ram_size,
-        .boot_device = boot_device,
-        .kernel_filename = kernel_filename,
-        .kernel_cmdline = kernel_cmdline,
-        .initrd_filename = initrd_filename,
-        .cpu_model = cpu_model,
+        .ram_size = args->ram_size,
+        .boot_device = args->boot_device,
+        .kernel_filename = args->kernel_filename,
+        .kernel_cmdline = args->kernel_cmdline,
+        .initrd_filename = args->initrd_filename,
+        .cpu_model = args->cpu_model,
         .pci_first_slot = 0x1,
         .pci_nr_slots = PCI_SLOT_MAX - 1,
         .fixup_devtree = e500plat_fixup_devtree,
diff --git a/hw/ppc/mpc8544ds.c b/hw/ppc/mpc8544ds.c
index 444da02..4e551af 100644
--- a/hw/ppc/mpc8544ds.c
+++ b/hw/ppc/mpc8544ds.c
@@ -28,19 +28,13 @@  static void mpc8544ds_fixup_devtree(PPCE500Params *params, void *fdt)
 
 static void mpc8544ds_init(QEMUMachineInitArgs *args)
 {
-    ram_addr_t ram_size = args->ram_size;
-    const char *boot_device = args->boot_device;
-    const char *cpu_model = args->cpu_model;
-    const char *kernel_filename = args->kernel_filename;
-    const char *kernel_cmdline = args->kernel_cmdline;
-    const char *initrd_filename = args->initrd_filename;
     PPCE500Params params = {
-        .ram_size = ram_size,
-        .boot_device = boot_device,
-        .kernel_filename = kernel_filename,
-        .kernel_cmdline = kernel_cmdline,
-        .initrd_filename = initrd_filename,
-        .cpu_model = cpu_model,
+        .ram_size = args->ram_size,
+        .boot_device = args->boot_device,
+        .kernel_filename = args->kernel_filename,
+        .kernel_cmdline = args->kernel_cmdline,
+        .initrd_filename = args->initrd_filename,
+        .cpu_model = args->cpu_model,
         .pci_first_slot = 0x11,
         .pci_nr_slots = 2,
         .fixup_devtree = mpc8544ds_fixup_devtree,