From nobody Tue Feb 10 17:08:08 2026 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; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529581335608563.0664778261253; Thu, 21 Jun 2018 04:42:15 -0700 (PDT) Received: from localhost ([::1]:54644 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVxyc-0000l0-MC for importer@patchew.org; Thu, 21 Jun 2018 07:42:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVxwx-0008GV-BP for qemu-devel@nongnu.org; Thu, 21 Jun 2018 07:40:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVxww-0004Gp-A6 for qemu-devel@nongnu.org; Thu, 21 Jun 2018 07:40:27 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:44990) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVxww-0004Gh-3v; Thu, 21 Jun 2018 07:40:26 -0400 Received: by mail-qt0-x243.google.com with SMTP id x5-v6so1761758qte.11; Thu, 21 Jun 2018 04:40:25 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id o25-v6sm2690685qtp.72.2018.06.21.04.40.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jun 2018 04:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jaWdFZsaQ82hsmTt8wZLeSqOJKO8Dw6mbuu7zloy5MQ=; b=Zz5zVq8jK6TYp86D3yYhav2XhKL2CDEqdNwEyFl6JQxdOOGHXawQHdJN56AY9wlXTE 4ruxa6zeavQFOElZ2Rr+uOZwP6zdYLCThZEZ7tnnCx5d/Gp7fdJVaWsBVNBLGDDfHFpg f3B2oC7EWaJ9teDrRhriUno20oc8xnN15lV7O+Y7CD4mZYu01O/EQ2Uh/q9Nv9uzwomn 90aPC7kYFNxpM8E8Vv8WCpWYs9X2WsB2gdPcAqSdzxLiYRiKVD4K0Hms7cf3AdhUprsR jGGBeG3lubrax6l73VcNOJX4SLtpeeL/lI6ZXl4ZEETYKLUNKAWuGwjVJJKFAHnR+tJm 7Mpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=jaWdFZsaQ82hsmTt8wZLeSqOJKO8Dw6mbuu7zloy5MQ=; b=cM7++IycFwVUxNAkQerRaC8sVPHvwklcPE/ikafAp9I3r1jPUKfE3ENIhS4Ww0+TuR Dean4CcqciNZWRFlQGjokNeeS29ObJf7HI39NmHhzUA/mxU8l2RxxXGIamwUfciGA14I yzmUHoe7YTtUeBZKf6qVAdFgHGij9brveKvNzkzWbiMp4xZ+Aj4lPXtz2cqCoIgDUf6b PzylGJ5D49v6kOQuEcRv9XWoU+8pLoNcyGNMhE5/Tj8I8R4mWaT802Xbs9HvaeAtsrlP n8gd0Wdd6zN0GDxygpSEtSDfGxaFNtUBMfp0hVg7q6bpqJSwznYtBLBAjDzSvjHwuTN5 u2Pw== X-Gm-Message-State: APt69E18jFijyVDvDNA+to3ZtoK8sRS8D/GddDnMi7RyI3U5WAPauhH0 XLbJDjCKQ5zNJ+4mx5Vu+ts= X-Google-Smtp-Source: ADUXVKIT4SPo+aDa0kZrXdmsk0dw7KId71Dt9CkpOq3oaHaxhuBJNNZpck58mI25Cm9szwb6obiWpA== X-Received: by 2002:ac8:503:: with SMTP id u3-v6mr23240212qtg.114.1529581225517; Thu, 21 Jun 2018 04:40:25 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster Date: Thu, 21 Jun 2018 08:40:13 -0300 Message-Id: <20180621114015.9207-2-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0.rc2 In-Reply-To: <20180621114015.9207-1-f4bug@amsat.org> References: <20180621114015.9207-1-f4bug@amsat.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: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH v3 1/3] 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: , Cc: Kevin Wolf , qemu-block@nongnu.org, qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 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 --- 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 cd29e27d8f..7c1c57f57f 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.18.0.rc2