From nobody Thu Dec 18 17:55:30 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530284841203139.88072935919354; Fri, 29 Jun 2018 08:07:21 -0700 (PDT) Received: from localhost ([::1]:42838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYuzY-0001Zc-8E for importer@patchew.org; Fri, 29 Jun 2018 11:07:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYumi-0007OK-CJ for qemu-devel@nongnu.org; Fri, 29 Jun 2018 10:54:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYumg-0006NE-9p for qemu-devel@nongnu.org; Fri, 29 Jun 2018 10:54:04 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:43086) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fYumf-0005dk-MG for qemu-devel@nongnu.org; Fri, 29 Jun 2018 10:54:02 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fYumT-0004Tn-IO for qemu-devel@nongnu.org; Fri, 29 Jun 2018 15:53:49 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 29 Jun 2018 15:52:53 +0100 Message-Id: <20180629145347.652-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180629145347.652-1-peter.maydell@linaro.org> References: <20180629145347.652-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 01/55] hw/block/fdc: Replace error_setg(&error_abort) by assert() 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 From: Philippe Mathieu-Daud=C3=A9 Use assert() instead of error_setg(&error_abort), as suggested by the "qapi/error.h" documentation: Please don't error_setg(&error_fatal, ...), use error_report() and exit(), because that's more obvious. Likewise, don't error_setg(&error_abort, ...), use assert(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: John Snow Message-id: 20180625165749.3910-2-f4bug@amsat.org Signed-off-by: Peter Maydell --- hw/block/fdc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index cd29e27d8f5..7c1c57f57fa 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -396,16 +396,9 @@ static int pick_geometry(FDrive *drv) nb_sectors, FloppyDriveType_str(parse->drive)); } + assert(type_match !=3D -1 && "misconfigured fd_format"); match =3D type_match; } - - /* No match of any kind found -- fd_format is misconfigured, abort. */ - if (match =3D=3D -1) { - error_setg(&error_abort, "No candidate geometries present in table= " - " for floppy drive type '%s'", - FloppyDriveType_str(drv->drive)); - } - parse =3D &(fd_formats[match]); =20 out: --=20 2.17.1