From nobody Tue Feb 10 13:16:37 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 152838361561223.985431787082575; Thu, 7 Jun 2018 08:00:15 -0700 (PDT) Received: from localhost ([::1]:58438 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQwOZ-0002Dv-1G for importer@patchew.org; Thu, 07 Jun 2018 11:00:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQwBu-0000oS-1W for qemu-devel@nongnu.org; Thu, 07 Jun 2018 10:47:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQwBt-0008C9-5r for qemu-devel@nongnu.org; Thu, 07 Jun 2018 10:47:06 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:33522) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fQwBt-0008Bp-0j; Thu, 07 Jun 2018 10:47:05 -0400 Received: by mail-qk0-x242.google.com with SMTP id h7-v6so6723408qkm.0; Thu, 07 Jun 2018 07:47:04 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id s128-v6sm11607363qkh.2.2018.06.07.07.46.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 07:47:03 -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=5uzXa8Nq8BEcI0ZuswhY5o9lBuNoRfH3yZmZoYECPKc=; b=Wc0g7fevCLQ0y4aVSYsQJlN3XbvkW7G0nmTVCxHSjplsb3rK8bYmtJq+FvY/U9+acL sLezw2D9lD7Xma8v4OEkrMSXWIqamqQkrJgewiBOEBqS3NGd5aMezeGOAfMzmO3ee12y WX+dk9C+IP8msjBjqjgro1l2FZQVF1tLRsFyH3Sjk/kcVYbN3vqn29D//3WWRgUL8eul IlX531hlHDS7IC1T8Yq8DoUrwrAf1UwQ1mwN7kkOdwGB3zws99oAKuILbwrKyuyvr+pu gcW15hQWHIfVku5P7wHFJuhS5kQYuspWMJ1AhLI/kQRSS20d+/ydoMioFkSNV5Dl6H7G IKEw== 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=5uzXa8Nq8BEcI0ZuswhY5o9lBuNoRfH3yZmZoYECPKc=; b=fr+32i1YnoliUU+DPAKLXeZ/MvW1SlmQK941unO+BcTnnFPOJfBk6Ztubs9p8HcV/p BULEmujNx12ikcCsh5WRfHCmiHNyCryZT2LsmV5gWyOIbUeIXENnkzb1QBYu64PhTHkn s8sfVVkomYiEpr6ZfO3jKICORtiBIsneOgaYoiSkqTYdX0YDG9w/jH6Ml2mk2Bq6o4Ub ijsb6tb+eOQOsH3kkiPoPE1tN1GlnIrLkYlX4J8Cwdie5sqCrxSYlIHswpQWPbpmMaez Cplkz58yJqhtBEU5+zVZvNtju1W0zPl9VSqi/4fTJq4PC1lWWqmkLWylC6vTXptSmyOX T3ZA== X-Gm-Message-State: APt69E3UC+eJ5w66IgBPDOYawU7Xfno8ujL2y9g5L2ADhux1kQQA+OCL f+WhRA+zcyPXEnKCEpkLSIc= X-Google-Smtp-Source: ADUXVKJL0yFqUFenXujb0S84Lr2JsYxIZwfunZvwFv7a3F7x2kH7nAREMijWPorh2gOeHP6+uv5mGA== X-Received: by 2002:a37:4ecb:: with SMTP id c194-v6mr1751219qkb.151.1528382824450; Thu, 07 Jun 2018 07:47:04 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eric Blake , Markus Armbruster , John Snow , Kevin Wolf , Max Reitz Date: Thu, 7 Jun 2018 11:46:42 -0300 Message-Id: <20180607144645.10187-2-f4bug@amsat.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180607144645.10187-1-f4bug@amsat.org> References: <20180607144645.10187-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:c09::242 Subject: [Qemu-devel] [PATCH v2 1/4] 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: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, qemu-devel@nongnu.org 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 --- 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.17.1