qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 04/12] etraxfs_eth: Don't use hw_error() in init


From: Edgar E. Iglesias
Subject: Re: [Qemu-devel] [PATCH 04/12] etraxfs_eth: Don't use hw_error() in init() method
Date: Thu, 10 Dec 2015 11:32:50 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Dec 10, 2015 at 11:29:24AM +0100, Markus Armbruster wrote:
> Device init() methods aren't supposed to call hw_error(), they should
> report the error and fail cleanly.  Do that.
> 
> Cc: "Edgar E. Iglesias" <address@hidden>
> Signed-off-by: Markus Armbruster <address@hidden>

Reviewed-by: Edgar E. Iglesias <address@hidden>


> ---
>  hw/net/etraxfs_eth.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/net/etraxfs_eth.c b/hw/net/etraxfs_eth.c
> index d600275..b562ac9 100644
> --- a/hw/net/etraxfs_eth.c
> +++ b/hw/net/etraxfs_eth.c
> @@ -26,6 +26,7 @@
>  #include "hw/sysbus.h"
>  #include "net/net.h"
>  #include "hw/cris/etraxfs.h"
> +#include "qemu/error-report.h"
>  
>  #define D(x)
>  
> @@ -589,7 +590,8 @@ static int fs_eth_init(SysBusDevice *sbd)
>      ETRAXFSEthState *s = ETRAX_FS_ETH(dev);
>  
>      if (!s->dma_out || !s->dma_in) {
> -        hw_error("Unconnected ETRAX-FS Ethernet MAC.\n");
> +        error_report("Unconnected ETRAX-FS Ethernet MAC");
> +        return -1;
>      }
>  
>      s->dma_out->client.push = eth_tx_push;
> -- 
> 2.4.3
> 



reply via email to

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