From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8ucF-0000mW-7v for qemu-devel@nongnu.org; Tue, 15 Dec 2015 13:46:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8ucE-00025T-3N for qemu-devel@nongnu.org; Tue, 15 Dec 2015 13:46:27 -0500 Received: from mail-vk0-x22a.google.com ([2607:f8b0:400c:c05::22a]:33037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8ucE-00025O-04 for qemu-devel@nongnu.org; Tue, 15 Dec 2015 13:46:26 -0500 Received: by mail-vk0-x22a.google.com with SMTP id a188so11750751vkc.0 for ; Tue, 15 Dec 2015 10:46:25 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4039864990f6dd36d79c799bdf183c3df18002d0.1448268409.git.alistair.francis@xilinx.com> References: <4039864990f6dd36d79c799bdf183c3df18002d0.1448268409.git.alistair.francis@xilinx.com> From: Peter Maydell Date: Tue, 15 Dec 2015 18:46:06 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v4 4/5] xlnx-zynqmp: Connect the SPI devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alistair Francis Cc: Edgar Iglesias , "Edgar E. Iglesias" , Peter Crosthwaite , QEMU Developers On 23 November 2015 at 08:54, Alistair Francis wrote: > Connect the Xilinx SPI devices to the ZynqMP model. > > Signed-off-by: Alistair Francis > + /* Rename each SPI bus after the SPI device to allow the board > + * to access all of the busses from the SoC. > + */ > + spi_bus = qdev_get_child_bus(DEVICE(&s->spi[i]), "spi0"); > + snprintf(bus_name, 6, "spi%d", i); > + memcpy((char *) spi_bus->name, bus_name, 6 * sizeof(char)); This looks very dubious. If we need to be able to rename buses can we provide a proper API to do it please, rather than just memcpying into the name field? thanks -- PMM