qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/5] hw/ppc/sam460ex: Remove unreachable code calling pflash_


From: Bernhard Beschow
Subject: Re: [PATCH 1/5] hw/ppc/sam460ex: Remove unreachable code calling pflash_cfi01_register()
Date: Mon, 09 Jan 2023 16:42:42 +0000


Am 9. Januar 2023 12:01:50 UTC schrieb "Philippe Mathieu-Daudé" 
<philmd@linaro.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é <philmd@linaro.org>
>---
> hw/ppc/sam460ex.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)

It looks like there is more: 
https://lists.nongnu.org/archive/html/qemu-devel/2022-10/msg02491.html

Best regards,
Bernhard

>
>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,"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]