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 70D1BC54EBD for ; Mon, 9 Jan 2023 13:42:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pErSB-0000wW-19; Mon, 09 Jan 2023 07:40:39 -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 1pErS9-0000vQ-Ee; Mon, 09 Jan 2023 07:40:37 -0500 Received: from zero.eik.bme.hu ([152.66.115.2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pErS7-0003gV-Iw; Mon, 09 Jan 2023 07:40:37 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 8DF5A746324; Mon, 9 Jan 2023 13:38:11 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 5A4B57462DB; Mon, 9 Jan 2023 13:38:11 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zero.eik.bme.hu (Postfix) with ESMTP id 57A337457E7; Mon, 9 Jan 2023 13:38:11 +0100 (CET) Date: Mon, 9 Jan 2023 13:38:11 +0100 (CET) From: BALATON Zoltan To: =?ISO-8859-15?Q?Philippe_Mathieu-Daud=E9?= cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Subject: Re: [PATCH 1/5] hw/ppc/sam460ex: Remove unreachable code calling pflash_cfi01_register() In-Reply-To: <20230109120154.2868-2-philmd@linaro.org> Message-ID: <3185e163-c72d-a741-2b4c-d952932b5948@eik.bme.hu> References: <20230109120154.2868-1-philmd@linaro.org> <20230109120154.2868-2-philmd@linaro.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="3866299591-646299802-1673267891=:7264" Received-SPF: pass client-ip=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --3866299591-646299802-1673267891=:7264 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT On Mon, 9 Jan 2023, Philippe Mathieu-Daudé wrote: > 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," > --3866299591-646299802-1673267891=:7264--