From patchwork Tue Mar 5 16:28:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1051840 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44DMnl02htz9s4V for ; Wed, 6 Mar 2019 03:30:35 +1100 (AEDT) Received: from localhost ([127.0.0.1]:45389 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1Cxc-0007T1-U6 for incoming@patchwork.ozlabs.org; Tue, 05 Mar 2019 11:30:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1Cvx-0006UJ-35 for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:28:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1Cvw-0002Lf-7v for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:28:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35110) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1Cvw-0002Kx-0V for qemu-devel@nongnu.org; Tue, 05 Mar 2019 11:28:48 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A235BDFF; Tue, 5 Mar 2019 16:28:47 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-67.brq.redhat.com [10.40.204.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0C246013F; Tue, 5 Mar 2019 16:28:40 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Date: Tue, 5 Mar 2019 17:28:25 +0100 Message-Id: <20190305162829.20079-2-philmd@redhat.com> In-Reply-To: <20190305162829.20079-1-philmd@redhat.com> References: <20190305162829.20079-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 05 Mar 2019 16:28:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/5] hw/mips/malta: Fix the DEBUG_BOARD_INIT code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?b?YXVkw6k=?= , Aleksandar Markovic , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Commit fa1d36df746 missed to convert this ifdef'ed out code. Introduce the pflash_blk variable. This fixes: hw/mips/mips_malta.c:1273:16: error: implicit declaration of function ‘blk_name’; did you mean ‘basename’? [-Werror=implicit-function-declaration] blk_name(dinfo->bdrv), fl_sectors); ^~~~~~~~ hw/mips/mips_malta.c:1273:16: error: nested extern declaration of ‘blk_name’ [-Werror=nested-externs] hw/mips/mips_malta.c:1273:30: error: ‘DriveInfo’ {aka ‘struct DriveInfo’} has no member named ‘bdrv’ blk_name(dinfo->bdrv), fl_sectors); ^~ Fixes: fa1d36df746 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Aleksandar Markovic --- hw/mips/mips_malta.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 2827074e9b..b4cd8f02ad 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -40,6 +40,7 @@ #include "hw/pci/pci.h" #include "sysemu/sysemu.h" #include "sysemu/arch_init.h" +#include "sysemu/block-backend.h" #include "qemu/log.h" #include "hw/mips/bios.h" #include "hw/ide.h" @@ -1205,6 +1206,7 @@ void mips_malta_init(MachineState *machine) qemu_irq cbus_irq, i8259_irq; int piix4_devfn; I2CBus *smbus; + BlockBackend *pflash_blk = NULL; DriveInfo *dinfo; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; int fl_idx = 0; @@ -1265,17 +1267,18 @@ void mips_malta_init(MachineState *machine) /* Load firmware in flash / BIOS. */ dinfo = drive_get(IF_PFLASH, 0, fl_idx); -#ifdef DEBUG_BOARD_INIT if (dinfo) { + pflash_blk = blk_by_legacy_dinfo(dinfo); +#ifdef DEBUG_BOARD_INIT printf("Register parallel flash %d size " TARGET_FMT_lx " at " - "addr %08llx '%s' %x\n", - fl_idx, bios_size, FLASH_ADDRESS, - blk_name(dinfo->bdrv), fl_sectors); - } + "addr %08llx '%s'\n", + fl_idx, blk_getlength(pflash_blk), FLASH_ADDRESS, + blk_name(pflash_blk)); #endif + } fl = pflash_cfi01_register(FLASH_ADDRESS, NULL, "mips_malta.bios", BIOS_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + pflash_blk, 65536, fl_sectors, 4, 0x0000, 0x0000, 0x0000, 0x0000, be); bios = pflash_cfi01_get_memory(fl);