On Fri, Jan 15, 2016 at 7:21 AM, Peter Maydell <peter.mayd...@linaro.org> wrote: > On 7 January 2016 at 15:55, Peter Maydell <peter.mayd...@linaro.org> wrote: >> On 20 December 2015 at 05:43, Peter Crosthwaite >> <crosthwaitepe...@gmail.com> wrote: >>> + for (i = 0; i < XLNX_ZYNQMP_NUM_SPIS; i++) { >>> + char bus_name[6]; >>> + >>> + object_property_set_bool(OBJECT(&s->spi[i]), true, "realized", >>> &err); >>> + >>> + sysbus_mmio_map(SYS_BUS_DEVICE(&s->spi[i]), 0, spi_addr[i]); >>> + sysbus_connect_irq(SYS_BUS_DEVICE(&s->spi[i]), 0, >>> + gic_spi[spi_intr[i]]); >>> + >>> + /* Alias controller SPI bus to the SoC itself */ >>> + snprintf(bus_name, 6, "spi%d", i); >> >> I don't much like these hard coded 6s. This is in init which >> isn't a hot path, so the simplest thing is to use g_strdup_printf() >> and then g_free() it when we're done. >> >> Similarly in patch 6. >> >> Otherwise I like this; I did a quick tweak to my sd card patchset >> to use this approach and it seems to at least compile and do >> the right thing in info qtree (I don't have a xilinx test image >> to do more). >> >> Haven't looked at the detail of how we're doing this in patch 1 yet. > > Hi Peter (and/or Alistair) -- do you have time to do a quick respin > of this patchset to use g_strdup_printf() in these cases? It would > be nice to get this series into the tree, because my sd card rework > patchset depends on it...
Yep! I'll do it now. Thanks, Alistair > > thanks > -- PMM >