|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [PATCH v3 2/9] hw/{arm,ppc}: Resolve unreachable code |
Date: | Mon, 17 Oct 2022 22:57:06 +0200 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 |
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? From the pflash API perspective I don't see much value in returning a PFlashCFI0X type instead of a simple DeviceState (but this is another story...).
Signed-off-by: Bernhard Beschow <shentey@gmail.com> --- hw/arm/gumstix.c | 18 ++++++------------ hw/arm/mainstone.c | 13 +++++-------- hw/arm/omap_sx1.c | 22 ++++++++-------------- hw/arm/versatilepb.c | 6 ++---- hw/arm/z2.c | 9 +++------ hw/ppc/sam460ex.c | 12 ++++-------- 6 files changed, 28 insertions(+), 52 deletions(-)
[Prev in Thread] | Current Thread | [Next in Thread] |