qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH trivial v1 1/2] microblaze: ml605: Get rid of ddr_base variable
@ 2014-08-18  0:52 Peter Crosthwaite
  2014-08-18  0:53 ` [Qemu-devel] [PATCH trivial v1 2/2] dma: axidma: Variablise repeated s->streams[i] sub-expr Peter Crosthwaite
  2014-08-18 11:44 ` [Qemu-devel] [Qemu-trivial] [PATCH trivial v1 1/2] microblaze: ml605: Get rid of ddr_base variable Michael Tokarev
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Crosthwaite @ 2014-08-18  0:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, edgar.iglesias

It's a constant based on a macro. Just use the macro in place.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---

 hw/microblaze/petalogix_ml605_mmu.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c
index aea9c5b..6843abf 100644
--- a/hw/microblaze/petalogix_ml605_mmu.c
+++ b/hw/microblaze/petalogix_ml605_mmu.c
@@ -89,7 +89,6 @@ petalogix_ml605_init(MachineState *machine)
     SysBusDevice *busdev;
     DriveInfo *dinfo;
     int i;
-    hwaddr ddr_base = MEMORY_BASEADDR;
     MemoryRegion *phys_lmb_bram = g_new(MemoryRegion, 1);
     MemoryRegion *phys_ram = g_new(MemoryRegion, 1);
     qemu_irq irq[32];
@@ -106,7 +105,7 @@ petalogix_ml605_init(MachineState *machine)
 
     memory_region_init_ram(phys_ram, NULL, "petalogix_ml605.ram", ram_size);
     vmstate_register_ram_global(phys_ram);
-    memory_region_add_subregion(address_space_mem, ddr_base, phys_ram);
+    memory_region_add_subregion(address_space_mem, MEMORY_BASEADDR, phys_ram);
 
     dinfo = drive_get(IF_PFLASH, 0, 0);
     /* 5th parameter 2 means bank-width
@@ -201,7 +200,7 @@ petalogix_ml605_init(MachineState *machine)
         }
     }
 
-    microblaze_load_kernel(cpu, ddr_base, ram_size,
+    microblaze_load_kernel(cpu, MEMORY_BASEADDR, ram_size,
                            machine->initrd_filename,
                            BINARY_DEVICE_TREE_FILE,
                            machine_cpu_reset);
-- 
2.0.1.1.gfbfc394

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH trivial v1 2/2] dma: axidma: Variablise repeated s->streams[i] sub-expr
  2014-08-18  0:52 [Qemu-devel] [PATCH trivial v1 1/2] microblaze: ml605: Get rid of ddr_base variable Peter Crosthwaite
@ 2014-08-18  0:53 ` Peter Crosthwaite
  2014-08-18 11:44 ` [Qemu-devel] [Qemu-trivial] [PATCH trivial v1 1/2] microblaze: ml605: Get rid of ddr_base variable Michael Tokarev
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Crosthwaite @ 2014-08-18  0:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, edgar.iglesias

This have 6 inline usages. Make it a bit more readable by using a local
variable.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---
Theres three more usages of this in coming patches, that would push
the number of usages higher

 hw/dma/xilinx_axidma.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c
index ee60d3f..d06002d 100644
--- a/hw/dma/xilinx_axidma.c
+++ b/hw/dma/xilinx_axidma.c
@@ -553,10 +553,12 @@ static void xilinx_axidma_realize(DeviceState *dev, Error **errp)
     int i;
 
     for (i = 0; i < 2; i++) {
-        s->streams[i].nr = i;
-        s->streams[i].bh = qemu_bh_new(timer_hit, &s->streams[i]);
-        s->streams[i].ptimer = ptimer_init(s->streams[i].bh);
-        ptimer_set_freq(s->streams[i].ptimer, s->freqhz);
+        struct Stream *st = &s->streams[i];
+
+        st->nr = i;
+        st->bh = qemu_bh_new(timer_hit, st);
+        st->ptimer = ptimer_init(st->bh);
+        ptimer_set_freq(st->ptimer, s->freqhz);
     }
     return;
 
-- 
2.0.1.1.gfbfc394

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH trivial v1 1/2] microblaze: ml605: Get rid of ddr_base variable
  2014-08-18  0:52 [Qemu-devel] [PATCH trivial v1 1/2] microblaze: ml605: Get rid of ddr_base variable Peter Crosthwaite
  2014-08-18  0:53 ` [Qemu-devel] [PATCH trivial v1 2/2] dma: axidma: Variablise repeated s->streams[i] sub-expr Peter Crosthwaite
@ 2014-08-18 11:44 ` Michael Tokarev
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Tokarev @ 2014-08-18 11:44 UTC (permalink / raw)
  To: Peter Crosthwaite, qemu-devel; +Cc: qemu-trivial, edgar.iglesias

18.08.2014 04:52, Peter Crosthwaite wrote:
> It's a constant based on a macro. Just use the macro in place.

Applied both to -trivial, thanks!

/mjt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-18 11:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-18  0:52 [Qemu-devel] [PATCH trivial v1 1/2] microblaze: ml605: Get rid of ddr_base variable Peter Crosthwaite
2014-08-18  0:53 ` [Qemu-devel] [PATCH trivial v1 2/2] dma: axidma: Variablise repeated s->streams[i] sub-expr Peter Crosthwaite
2014-08-18 11:44 ` [Qemu-devel] [Qemu-trivial] [PATCH trivial v1 1/2] microblaze: ml605: Get rid of ddr_base variable Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).