From patchwork Mon Jan 9 12:01:50 2023 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: 13093377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A21F5C54EBE for ; Mon, 9 Jan 2023 12:30:59 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEqqw-0005sJ-N0; Mon, 09 Jan 2023 07:02:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEqqt-0005oa-6o for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:02:07 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqqp-0001uW-PN for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:02:06 -0500 Received: by mail-wm1-x32b.google.com with SMTP id p3-20020a05600c1d8300b003d9ee5f125bso2312206wms.4 for ; Mon, 09 Jan 2023 04:02:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c6I1HLCSYyw0uAOoILOG7NYLqOybQWcLBPyeCZd7TC0=; b=xg9IfuLI7eQOsq6ONF5YgbO9EswzewJzZ7mXUWKY/+tkBLy+bo33lQNdSBahGMH/I7 q6Cfnd2GL8D6M7dnejza88qrS61xE+g8FLsF/1tQCiOJCEsUxkpJ9j030wm7LZnT9Q3h jOkddAkCxp13S7/X2b4RNi1htgt7pCdicYSG1Qej3TqdJ9uqEzNdvakjetrlrLNVjsw2 O4oXPYAJp+8a7Ib8C8ahMnrexrfrHSfp09qjtxwnt89dnZxfNTXZm5O+7iQtYxSVpWcC 6DyN3wOqYJN3iEwe8zY7NJW7LI9ALFQR8QZM2bUTMNGwrez8zfzX6wOqgTy9wtzB3KZM ZGkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c6I1HLCSYyw0uAOoILOG7NYLqOybQWcLBPyeCZd7TC0=; b=nKNePpQ80tmS5pqMZJU90xoMB7qGo/AlLTfLk6XUGbMC/ES+D0Qse5ruiRJIHrclhn Ieqdpwld2n6ndK2tf3cX1ZCO0id1SvJCsU+wBy0X4pWwKZntNaPb54cVFSLn7QdiY2Ch 38aVZ5FIEx2gniZZIp7ToTbrWfukp35n7dB3m/00dj0vJKWvjkUnlC2j+zGRD2O/Fh70 9QwpIB4xHGLldUTk/FV1jaxzwuCQ9MoYalLBkD3nLkc6hfISMHa26DWXLzPE0Vfoh5Ll cxs9d44KkL5Uw5HiwpwBQ2NdhVauc+F/lRQQq10n/kqTuBITatUOtVnieOYRyqmmtFQy j1RA== X-Gm-Message-State: AFqh2krtTPtX0xxddvCw7BMsVKAVprKikXLxPbqqAXjtAABTvY6CRRit zm8norqtg+MuQSJj64RLUARhmgbeeJerauwv X-Google-Smtp-Source: AMrXdXu1ZGkSk0WGtMytH4NKZzxuRWX73Ve68/XnfpSEN7YD22gJgESRjCP6z3D7IOaOmd2OH3V5xQ== X-Received: by 2002:a05:600c:4d14:b0:3d3:5c7d:a5f3 with SMTP id u20-20020a05600c4d1400b003d35c7da5f3mr49498434wmp.37.1673265721968; Mon, 09 Jan 2023 04:02:01 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id bi22-20020a05600c3d9600b003d208eb17ecsm11123199wmb.26.2023.01.09.04.02.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 04:02:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Yoshinori Sato , Aurelien Jarno , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Jiaxun Yang , Magnus Damm , qemu-ppc@nongnu.org, BALATON Zoltan Subject: [PATCH 1/5] hw/ppc/sam460ex: Remove unreachable code calling pflash_cfi01_register() Date: Mon, 9 Jan 2023 13:01:50 +0100 Message-Id: <20230109120154.2868-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109120154.2868-1-philmd@linaro.org> References: <20230109120154.2868-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Since its QOM'ification in commit 368a354f02 ("pflash_cfi0x: QOMified") the pflash_cfi01_register() function does not fail. This call was later converted with a script to use &error_fatal, still unable to fail. Remove the unreachable code. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: BALATON Zoltan --- hw/ppc/sam460ex.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index 4a22ce3761..cf7213f7c9 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -103,14 +103,10 @@ static int sam460ex_load_uboot(void) DriveInfo *dinfo; dinfo = drive_get(IF_PFLASH, 0, 0); - if (!pflash_cfi01_register(FLASH_BASE | ((hwaddr)FLASH_BASE_H << 32), - "sam460ex.flash", FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - 64 * KiB, 1, 0x89, 0x18, 0x0000, 0x0, 1)) { - error_report("Error registering flash memory"); - /* XXX: return an error instead? */ - exit(1); - } + pflash_cfi01_register(FLASH_BASE | ((hwaddr)FLASH_BASE_H << 32), + "sam460ex.flash", FLASH_SIZE, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + 64 * KiB, 1, 0x89, 0x18, 0x0000, 0x0, 1)); if (!dinfo) { /*error_report("No flash image given with the 'pflash' parameter,"