From nobody Sun Feb 8 18:09:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155049474107621.711604331684043; Mon, 18 Feb 2019 04:59:01 -0800 (PST) Received: from localhost ([127.0.0.1]:57818 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gviVe-0001FT-1W for importer@patchew.org; Mon, 18 Feb 2019 07:58:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gviTM-000851-OC for qemu-devel@nongnu.org; Mon, 18 Feb 2019 07:56:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gviTL-0000lb-ER for qemu-devel@nongnu.org; Mon, 18 Feb 2019 07:56:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59642) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gviTI-0000Uj-5O; Mon, 18 Feb 2019 07:56:32 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 11674C0528D8; Mon, 18 Feb 2019 12:56:17 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CCD7D19748; Mon, 18 Feb 2019 12:56:16 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 57E6411385D4; Mon, 18 Feb 2019 13:56:15 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 13:56:07 +0100 Message-Id: <20190218125615.18970-3-armbru@redhat.com> In-Reply-To: <20190218125615.18970-1-armbru@redhat.com> References: <20190218125615.18970-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 18 Feb 2019 12:56:17 +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 02/10] pflash: Macro PFLASH_BUG() is used just once, expand 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: kwolf@redhat.com, qemu-block@nongnu.org, alex.bennee@linaro.org, mreitz@redhat.com, qemu-ppc@nongnu.org, lersek@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" PFLASH_BUG()'s lone use has a suspicious smell: it prints "Possible BUG", which sounds like a warning, then calls exit(1), followed by unreachable goto reset_flash. All this commit does is expanding the macro, so the smell becomes more poignant, and the macro can be deleted. Signed-off-by: Markus Armbruster Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Laszlo Ersek --- hw/block/pflash_cfi01.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c index 9efa7aa9af..f73c30a3ee 100644 --- a/hw/block/pflash_cfi01.c +++ b/hw/block/pflash_cfi01.c @@ -49,12 +49,6 @@ #include "sysemu/sysemu.h" #include "trace.h" =20 -#define PFLASH_BUG(fmt, ...) \ -do { \ - fprintf(stderr, "PFLASH: Possible BUG - " fmt, ## __VA_ARGS__); \ - exit(1); \ -} while(0) - /* #define PFLASH_DEBUG */ #ifdef PFLASH_DEBUG #define DPRINTF(fmt, ...) \ @@ -624,8 +618,8 @@ static void pflash_write(PFlashCFI01 *pfl, hwaddr offse= t, pfl->status |=3D 0x80; } else { DPRINTF("%s: unknown command for \"write block\"\n", __fun= c__); - PFLASH_BUG("Write block confirm"); - goto reset_flash; + fprintf(stderr, "PFLASH: Possible BUG - Write block confir= m"); + exit(1); } break; default: --=20 2.17.2