Message ID | 20230109120154.2868-2-philmd@linaro.org |
---|---|
State | New |
Headers | show |
Series | hw: Cleanups around PFLASH use | expand |
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é <philmd@linaro.org> Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu> > --- > 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," >
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,"
On 9/1/23 17:42, Bernhard Beschow wrote: > 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 Doh, my short-term memory scares me :\
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,"
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(-)