qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] hw: make *_exit functions return void


From: Cornelia Huck
Subject: Re: [Qemu-devel] [PATCH] hw: make *_exit functions return void
Date: Tue, 18 Apr 2017 18:15:04 +0200

On Sun, 16 Apr 2017 20:26:01 +0800
Zihan Yang <address@hidden> wrote:

>     According to the second suggestion listed on Dead code Removal
>     of BiteSizedTasks, I modify some *_exit functions to make them
>     return void. Some *_exit and *_exitfn functions that already
>     return void remain unchanged. Also, the checks for the callers
>     are deleted.
> 
> Signed-off-by: Zihan Yang <address@hidden>
> ---
>  hw/audio/hda-codec.c              | 3 +--
>  hw/audio/intel-hda.c              | 3 +--
>  hw/audio/intel-hda.h              | 2 +-
>  hw/char/sclpconsole-lm.c          | 3 +--
>  hw/char/sclpconsole.c             | 3 +--
>  hw/core/qdev.c                    | 6 +-----
>  hw/s390x/event-facility.c         | 6 +-----
>  hw/s390x/virtio-ccw.c             | 7 +++----
>  hw/s390x/virtio-ccw.h             | 2 +-
>  hw/usb/dev-smartcard-reader.c     | 3 +--
>  include/hw/qdev-core.h            | 2 +-
>  include/hw/s390x/event-facility.h | 2 +-
>  12 files changed, 14 insertions(+), 28 deletions(-)

Hm, I wondered why I had a deja vu... ah, here:
https://marc.info/?t=149003291200008&r=1&w=2

The author of that patch did not follow up AFAICS, but some of the
suggestions made in that thread apply to your patch as well.

In particular:


> diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c
> index 07d6ebd..6fa8922 100644
> --- a/hw/char/sclpconsole-lm.c
> +++ b/hw/char/sclpconsole-lm.c
> @@ -318,9 +318,8 @@ static int console_init(SCLPEvent *event)
>      return 0;
>  }
> 
> -static int console_exit(SCLPEvent *event)
> +static void console_exit(SCLPEvent *event)
>  {
> -    return 0;
>  }
> 
>  static void console_reset(DeviceState *dev)
> diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c
> index b78f240..d9bbc5e 100644
> --- a/hw/char/sclpconsole.c
> +++ b/hw/char/sclpconsole.c
> @@ -246,9 +246,8 @@ static void console_reset(DeviceState *dev)
>     scon->notify = false;
>  }
> 
> -static int console_exit(SCLPEvent *event)
> +static void console_exit(SCLPEvent *event)
>  {
> -    return 0;
>  }

These two now empty functions are not very useful; it is better to
simply remove them.

With that change, I'd take a split-out patch for sclp and virtio-ccw
through my tree, or I'd ack a not-split-out version.




reply via email to

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