On Thu, Jul 23, 2020 at 02:04:45PM -0500, Eric Blake wrote: > On 7/23/20 1:14 PM, Daniel P. Berrangé wrote: > > The object_ref/unref methods are intended for use with any subclass of > > the base Object. Using "Object *" in the signature is not adding any > > meaningful level of type safety, since callers simply use "OBJECT(ptr)" > > and this expands to an unchecked cast "(Object *)". > > > > By using "void *" we enable the object_unref() method to be used to > > provide support for g_autoptr() with any subclass. > > > > Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> > > --- > > include/qom/object.h | 4 ++-- > > qom/object.c | 6 ++++-- > > 2 files changed, 6 insertions(+), 4 deletions(-) > > Is it worth a followup patch (probably with Coccinelle) that changes: > > object_ref(OBJECT(dev)); > > to the now-simpler > > object_ref(dev);
Yes, its worth a cleanup. > But I don't think it belongs in this patch, so > > Reviewed-by: Eric Blake <ebl...@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|