[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] qobject: Update coccinelle script to catch
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] qobject: Update coccinelle script to catch Q{INC, DEC}REF |
Date: |
Fri, 09 Jun 2017 15:36:38 +0000 |
On Fri, Jun 9, 2017 at 7:33 PM Eric Blake <address@hidden> wrote:
> On 06/09/2017 10:28 AM, Marc-André Lureau wrote:
> > Hi
> >
> > On Fri, Jun 9, 2017 at 7:20 PM Eric Blake <address@hidden> wrote:
> >
> >> A recent patch submission was about to use qobject_decref(QOBJECT(E)),
> >> even though we already have QDECREF(E) for that purpose. While our
> >> tree is currently free from the longhand form, we might as well update
> >>
> >
> > Oh?
> >
> > $ git grep 'object_unref(OBJECT(' | wc -l
> > 152
>
> Quit mixing QOM and QObject ;)
>
> $ git grep qobject_'..cref(QOBJECT'
> include/qapi/qmp/qobject.h: qobject_incref(QOBJECT(obj))
> scripts/coccinelle/qobject.cocci:- qobject_incref(QOBJECT(E));
> scripts/coccinelle/qobject.cocci:- qobject_decref(QOBJECT(E));
>
>
>
Yeah, I got mixed by your comments, my patch doesn't do
qobject_decref(QOBJECT(E)) but object_unref(OBJECT(E)), which doesn't have
macro helper afaik.
> Yes, we may want to add a script to clean QOM abuses, but that's a
> different project for a different day.
>
> --
> Eric Blake, Principal Software Engineer
> Red Hat, Inc. +1-919-301-3266 <+1%20919-301-3266>
> Virtualization: qemu.org | libvirt.org
>
> --
Marc-André Lureau