Skip to contentSkip to conversation

Change return type of functions that are named *_exit or *_exitfn in hw/ from int to void

PATCH In review Nutan Shinde 1 participant 1 message Apr 12, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/5 Change return type of functions that are named *_exit or *_exitfn in hw/ from int to void

This changes is required because the return type of exit(error) function is not used. This patch only has changes for files in hw/audio package.

---
 hw/audio/hda-codec.c   | 3 +--
 hw/audio/intel-hda.c   | 3 +--
 hw/audio/intel-hda.h   | 2 +-
 include/hw/qdev-core.h | 2 +-
 4 files changed, 4 insertions(+), 6 deletions(-)
hw/audio/hda-codec.c +1 -2
index 52d4640..5402cd1 100644
@@ -520,7 +520,7 @@ static int hda_audio_init(HDACodecDevice *hda, const struct desc_codec *desc)
     return 0;
 }
 
-static int hda_audio_exit(HDACodecDevice *hda)
+static void hda_audio_exit(HDACodecDevice *hda)
 {
     HDAAudioState *a = HDA_AUDIO(hda);
     HDAAudioStream *st;
@@ -539,7 +539,6 @@ static int hda_audio_exit(HDACodecDevice *hda)
         }
     }
     AUD_remove_card(&a->card);
-    return 0;
 }
 
 static int hda_audio_post_load(void *opaque, int version)
hw/audio/intel-hda.c +1 -2
index d372d4a..404cfcf 100644
@@ -66,7 +66,7 @@ static int hda_codec_dev_init(DeviceState *qdev)
     return cdc->init(dev);
 }
 
-static int hda_codec_dev_exit(DeviceState *qdev)
+static void hda_codec_dev_exit(DeviceState *qdev)
 {
     HDACodecDevice *dev = DO_UPCAST(HDACodecDevice, qdev, qdev);
     HDACodecDeviceClass *cdc = HDA_CODEC_DEVICE_GET_CLASS(dev);
@@ -74,7 +74,6 @@ static int hda_codec_dev_exit(DeviceState *qdev)
     if (cdc->exit) {
         cdc->exit(dev);
     }
-    return 0;
 }
 
 HDACodecDevice *hda_codec_find(HDACodecBus *bus, uint32_t cad)
hw/audio/intel-hda.h +1 -1
index d784bcf..53b78da 100644
@@ -38,7 +38,7 @@ typedef struct HDACodecDeviceClass
     DeviceClass parent_class;
 
     int (*init)(HDACodecDevice *dev);
-    int (*exit)(HDACodecDevice *dev);
+    void (*exit)(HDACodecDevice *dev);
     void (*command)(HDACodecDevice *dev, uint32_t nid, uint32_t data);
     void (*stream)(HDACodecDevice *dev, uint32_t stnr, bool running, bool output);
 } HDACodecDeviceClass;
include/hw/qdev-core.h +1 -1
index 1ce02b2..0b635bd 100644
@@ -30,7 +30,7 @@ typedef enum DeviceCategory {
 } DeviceCategory;
 
 typedef int (*qdev_initfn)(DeviceState *dev);
-typedef int (*qdev_event)(DeviceState *dev);
+typedef void (*qdev_event)(DeviceState *dev);
 typedef void (*qdev_resetfn)(DeviceState *dev);
 typedef void (*DeviceRealize)(DeviceState *dev, Error **errp);
 typedef void (*DeviceUnrealize)(DeviceState *dev, Error **errp);
Signature · 1 line
1.9.1