From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKBza-0001FU-ST for qemu-devel@nongnu.org; Fri, 15 Jan 2016 16:33:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKBzZ-0007uh-V0 for qemu-devel@nongnu.org; Fri, 15 Jan 2016 16:33:10 -0500 MIME-Version: 1.0 Sender: alistair23@gmail.com In-Reply-To: References: <27dea50e71d768db3752dcad34be0f4c4234fd21.1450570397.git.crosthwaite.peter@gmail.com> From: Alistair Francis Date: Fri, 15 Jan 2016 13:32:39 -0800 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v6 5/6] xlnx-zynqmp: Connect the SPI devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Peter Crosthwaite , QEMU Developers , Alistair Francis , Peter Crosthwaite , qemu-arm , Paolo Bonzini On Fri, Jan 15, 2016 at 7:21 AM, Peter Maydell wrote: > On 7 January 2016 at 15:55, Peter Maydell wrote: >> On 20 December 2015 at 05:43, Peter Crosthwaite >> 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 >