Skip to contentSkip to conversation

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

PATCH In review Nutan Shinde 2 participants 2 messages Apr 12, 2016 – Apr 13, 2016 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

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

In reply to a message not in the archive

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

---
 hw/s390x/virtio-ccw.c | 7 +++----
 hw/s390x/virtio-ccw.h | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)
hw/s390x/virtio-ccw.c +1 -2
index d51642d..e8b5a38 100644
@@ -878,7 +878,7 @@ out_err:
     g_free(sch);
 }
 
-static int virtio_ccw_exit(VirtioCcwDevice *dev)
+static void virtio_ccw_exit(VirtioCcwDevice *dev)
 {
     SubchDev *sch = dev->sch;
 
@@ -890,7 +890,6 @@ static int virtio_ccw_exit(VirtioCcwDevice *dev)
         release_indicator(&dev->routes.adapter, dev->indicators);
         dev->indicators = NULL;
     }
-    return 0;
 }
 
 static void virtio_ccw_net_realize(VirtioCcwDevice *ccw_dev, Error **errp)
@@ -1735,12 +1734,12 @@ static void virtio_ccw_busdev_realize(DeviceState

*dev, Error **errp)

     virtio_ccw_device_realize(_dev, errp);

}

-static int virtio_ccw_busdev_exit(DeviceState *dev) +static void virtio_ccw_busdev_exit(DeviceState *dev)

 {
     VirtioCcwDevice *_dev = (VirtioCcwDevice *)dev;
     VirtIOCCWDeviceClass *_info = VIRTIO_CCW_DEVICE_GET_CLASS(dev);

- return _info->exit(_dev);
+ _info->exit(_dev);
}

static void virtio_ccw_busdev_unplug(HotplugHandler *hotplug_dev,

hw/s390x/virtio-ccw.h +1 -1
index 66c831b..854602f 100644
@@ -68,7 +68,7 @@ typedef struct VirtioCcwDevice VirtioCcwDevice;
 typedef struct VirtIOCCWDeviceClass {
     DeviceClass parent_class;
     void (*realize)(VirtioCcwDevice *dev, Error **errp);
-    int (*exit)(VirtioCcwDevice *dev);
+    void (*exit)(VirtioCcwDevice *dev);
 } VirtIOCCWDeviceClass;
 
 /* Performance improves when virtqueue kick processing is decoupled from

the
--
1.9.1

#2 lore raw
Quoted 3 lines · On Tue, 12 Apr 2016 23:57:06 +0530 Nutan Shinde <[email protected]>…

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

Some meta-notes (I saw the related discussion on qemu-devel; the comments there apply to this patch as well):

- The change is not 'required'. It's a cleanup because everybody returns 0 anyway.
- It often makes sense to cc: everybody on the cover letter so they can find out what the series is about without needing to dig it up on the mailing list.
- A patch series needs to preserve bisectability, i.e. at every point in the series the code must compile.
To achieve this, it often makes sense to split out self-contained changes restricted to a component (here: changes following from VirtIOCCWDeviceClass changes) from whole-tree changes (here: changes following from DeviceClass).

Quoted 6 lines
---
 hw/s390x/virtio-ccw.c | 7 +++----
 hw/s390x/virtio-ccw.h | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)