[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 2/9] hw/{arm,ppc}: Resolve unreachable code
From: |
Peter Maydell |
Subject: |
Re: [PATCH v3 2/9] hw/{arm,ppc}: Resolve unreachable code |
Date: |
Tue, 18 Oct 2022 10:25:09 +0100 |
On Mon, 17 Oct 2022 at 21:57, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> On 16/10/22 14:27, Bernhard Beschow wrote:
> > pflash_cfi01_register() always returns with a non-NULL pointer (otherwise
> > it would crash internally). Therefore, the bodies of the if-statements
> > are unreachable.
>
> This is true, pflash_cfi0X_register() use an hardcoded &error_fatal.
>
> Shouldn't it be better to pass an Error* argument?
The whole function is a legacy convenience-wrapper that's just
doing "create, configure, realize and wire up a device". New
code, and any callers that actually care about errors, should
just be directly creating and configuring the device anyway.
Almost all the callers are in old legacy board model code.
-- PMM
- [PATCH v3 0/9] ppc/e500: Add support for two types of flash, cleanup, Bernhard Beschow, 2022/10/16
- [PATCH v3 1/9] hw/block/pflash_cfi0{1, 2}: Error out if device length isn't a power of two, Bernhard Beschow, 2022/10/16
- [PATCH v3 2/9] hw/{arm,ppc}: Resolve unreachable code, Bernhard Beschow, 2022/10/16
- [PATCH v3 3/9] hw/block/pflash_cfi01: Attach memory region in boards, Bernhard Beschow, 2022/10/16
- [PATCH v3 4/9] hw/block/pflash_cfi02: Attach memory region in boards, Bernhard Beschow, 2022/10/16
- [PATCH v3 5/9] hw/sd/sdhci-internal: Unexport ESDHC defines, Bernhard Beschow, 2022/10/16
- [PATCH v3 6/9] hw/sd/sdhci: Rename ESDHC_* defines to USDHC_*, Bernhard Beschow, 2022/10/16
- [PATCH v3 7/9] hw/ppc/e500: Implement pflash handling, Bernhard Beschow, 2022/10/16
- Re: [PATCH v3 7/9] hw/ppc/e500: Implement pflash handling, Peter Maydell, 2022/10/18