qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH trivial v1 0/3] Initialise IRQ pointers as Zero
@ 2014-08-15  8:14 Peter Crosthwaite
  2014-08-15  8:14 ` [Qemu-devel] [PATCH trivial v1 1/3] ssi: xilinx_spi: Initialise CS GPIOs as NULL Peter Crosthwaite
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Peter Crosthwaite @ 2014-08-15  8:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, agraf


Hi,

I'm working on some QOM stuff that requires output IRQ pointers to be
initialised to zero. I have a catch-all workaround to the problem in
the series proper, but this is the startings of a more complete
solution.

Sending to trivial, as I think the change is an improvement
independently, just due to the fact its easier to debug with NULL
pointers rather than undefined pointer values.

Regards,
Peter


Peter Crosthwaite (3):
  ssi: xilinx_spi: Initialise CS GPIOs as NULL
  ppc: convert g_new(qemu_irq usages to g_new0
  intc: i8259: Convert Array allocation to g_new0

 hw/intc/i8259.c       | 2 +-
 hw/intc/openpic.c     | 2 +-
 hw/ppc/e500.c         | 2 +-
 hw/ppc/mac_newworld.c | 2 +-
 hw/ssi/xilinx_spi.c   | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

-- 
2.0.1.1.gfbfc394

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

* [Qemu-devel] [PATCH trivial v1 1/3] ssi: xilinx_spi: Initialise CS GPIOs as NULL
  2014-08-15  8:14 [Qemu-devel] [PATCH trivial v1 0/3] Initialise IRQ pointers as Zero Peter Crosthwaite
@ 2014-08-15  8:14 ` Peter Crosthwaite
  2014-08-15  8:15 ` [Qemu-devel] [PATCH trivial v1 2/3] ppc: convert g_new(qemu_irq usages to g_new0 Peter Crosthwaite
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Crosthwaite @ 2014-08-15  8:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, agraf

To properly indicate they are unconnected.

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

 hw/ssi/xilinx_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c
index 207f47a..620573c 100644
--- a/hw/ssi/xilinx_spi.c
+++ b/hw/ssi/xilinx_spi.c
@@ -329,7 +329,7 @@ static int xilinx_spi_init(SysBusDevice *sbd)
     s->spi = ssi_create_bus(dev, "spi");
 
     sysbus_init_irq(sbd, &s->irq);
-    s->cs_lines = g_new(qemu_irq, s->num_cs);
+    s->cs_lines = g_new0(qemu_irq, s->num_cs);
     ssi_auto_connect_slaves(dev, s->cs_lines, s->spi);
     for (i = 0; i < s->num_cs; ++i) {
         sysbus_init_irq(sbd, &s->cs_lines[i]);
-- 
2.0.1.1.gfbfc394

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

* [Qemu-devel] [PATCH trivial v1 2/3] ppc: convert g_new(qemu_irq usages to g_new0
  2014-08-15  8:14 [Qemu-devel] [PATCH trivial v1 0/3] Initialise IRQ pointers as Zero Peter Crosthwaite
  2014-08-15  8:14 ` [Qemu-devel] [PATCH trivial v1 1/3] ssi: xilinx_spi: Initialise CS GPIOs as NULL Peter Crosthwaite
@ 2014-08-15  8:15 ` Peter Crosthwaite
  2014-08-15  8:15 ` [Qemu-devel] [PATCH trivial v1 3/3] intc: i8259: Convert Array allocation " Peter Crosthwaite
  2014-08-15 14:55 ` [Qemu-devel] [Qemu-trivial] [PATCH trivial v1 0/3] Initialise IRQ pointers as Zero Michael Tokarev
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Crosthwaite @ 2014-08-15  8:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, agraf

To indicate the IRQs are initially disconnected.

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

 hw/intc/openpic.c     | 2 +-
 hw/ppc/e500.c         | 2 +-
 hw/ppc/mac_newworld.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c
index 028529e..7d1f3b9 100644
--- a/hw/intc/openpic.c
+++ b/hw/intc/openpic.c
@@ -1627,7 +1627,7 @@ static void openpic_realize(DeviceState *dev, Error **errp)
     }
 
     for (i = 0; i < opp->nb_cpus; i++) {
-        opp->dst[i].irqs = g_new(qemu_irq, OPENPIC_OUTPUT_NB);
+        opp->dst[i].irqs = g_new0(qemu_irq, OPENPIC_OUTPUT_NB);
         for (j = 0; j < OPENPIC_OUTPUT_NB; j++) {
             sysbus_init_irq(d, &opp->dst[i].irqs[j]);
         }
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 1a5b30d..16c85ef 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -583,7 +583,7 @@ static qemu_irq *ppce500_init_mpic(PPCE500Params *params, MemoryRegion *ccsr,
     SysBusDevice *s;
     int i;
 
-    mpic = g_new(qemu_irq, 256);
+    mpic = g_new0(qemu_irq, 256);
 
     if (kvm_enabled()) {
         QemuOpts *machine_opts = qemu_get_machine_opts();
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index f5bccd2..1ec4bb4 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -346,7 +346,7 @@ static void ppc_core99_init(MachineState *machine)
         }
     }
 
-    pic = g_new(qemu_irq, 64);
+    pic = g_new0(qemu_irq, 64);
 
     dev = qdev_create(NULL, TYPE_OPENPIC);
     qdev_prop_set_uint32(dev, "model", OPENPIC_MODEL_RAVEN);
-- 
2.0.1.1.gfbfc394

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

* [Qemu-devel] [PATCH trivial v1 3/3] intc: i8259: Convert Array allocation to g_new0
  2014-08-15  8:14 [Qemu-devel] [PATCH trivial v1 0/3] Initialise IRQ pointers as Zero Peter Crosthwaite
  2014-08-15  8:14 ` [Qemu-devel] [PATCH trivial v1 1/3] ssi: xilinx_spi: Initialise CS GPIOs as NULL Peter Crosthwaite
  2014-08-15  8:15 ` [Qemu-devel] [PATCH trivial v1 2/3] ppc: convert g_new(qemu_irq usages to g_new0 Peter Crosthwaite
@ 2014-08-15  8:15 ` Peter Crosthwaite
  2014-08-15 14:55 ` [Qemu-devel] [Qemu-trivial] [PATCH trivial v1 0/3] Initialise IRQ pointers as Zero Michael Tokarev
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Crosthwaite @ 2014-08-15  8:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, agraf

To be more array friendly and to indicate the IRQs are initially
disconnected.

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

 hw/intc/i8259.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c
index d0b0c52..a563b82 100644
--- a/hw/intc/i8259.c
+++ b/hw/intc/i8259.c
@@ -472,7 +472,7 @@ qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq)
     ISADevice *isadev;
     int i;
 
-    irq_set = g_malloc(ISA_NUM_IRQS * sizeof(qemu_irq));
+    irq_set = g_new0(qemu_irq, ISA_NUM_IRQS);
 
     isadev = i8259_init_chip(TYPE_I8259, bus, true);
     dev = DEVICE(isadev);
-- 
2.0.1.1.gfbfc394

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

* Re: [Qemu-devel] [Qemu-trivial] [PATCH trivial v1 0/3] Initialise IRQ pointers as Zero
  2014-08-15  8:14 [Qemu-devel] [PATCH trivial v1 0/3] Initialise IRQ pointers as Zero Peter Crosthwaite
                   ` (2 preceding siblings ...)
  2014-08-15  8:15 ` [Qemu-devel] [PATCH trivial v1 3/3] intc: i8259: Convert Array allocation " Peter Crosthwaite
@ 2014-08-15 14:55 ` Michael Tokarev
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Tokarev @ 2014-08-15 14:55 UTC (permalink / raw)
  To: Peter Crosthwaite, qemu-devel; +Cc: qemu-trivial, agraf

15.08.2014 12:14, Peter Crosthwaite wrote:
> Hi,
> 
> I'm working on some QOM stuff that requires output IRQ pointers to be
> initialised to zero. I have a catch-all workaround to the problem in
> the series proper, but this is the startings of a more complete
> solution.
> 
> Sending to trivial, as I think the change is an improvement
> independently, just due to the fact its easier to debug with NULL
> pointers rather than undefined pointer values.

Applied all 3 to -trivial, thank you!

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

end of thread, other threads:[~2014-08-15 14:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-15  8:14 [Qemu-devel] [PATCH trivial v1 0/3] Initialise IRQ pointers as Zero Peter Crosthwaite
2014-08-15  8:14 ` [Qemu-devel] [PATCH trivial v1 1/3] ssi: xilinx_spi: Initialise CS GPIOs as NULL Peter Crosthwaite
2014-08-15  8:15 ` [Qemu-devel] [PATCH trivial v1 2/3] ppc: convert g_new(qemu_irq usages to g_new0 Peter Crosthwaite
2014-08-15  8:15 ` [Qemu-devel] [PATCH trivial v1 3/3] intc: i8259: Convert Array allocation " Peter Crosthwaite
2014-08-15 14:55 ` [Qemu-devel] [Qemu-trivial] [PATCH trivial v1 0/3] Initialise IRQ pointers as Zero 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).