[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 4/4] qobject: modify qobject_ref() to assert
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH v4 4/4] qobject: modify qobject_ref() to assert on NULL and return obj |
Date: |
Tue, 17 Apr 2018 15:29:47 +0200 |
Hi
On Mon, Apr 16, 2018 at 10:26 AM, Markus Armbruster <address@hidden> wrote:
> Marc-André Lureau <address@hidden> writes:
>
>> Following a discussion on the mailing list:
>
> If a reader of this commit message could profit from reading the
> discussion, refer to it by URL and/or Message-Id. If not, don't mention
> it.
>
>> while it may be convenient
>> to accept NULL value in qobject_unref() (for similar reasons as free()
>> accepts NULL), it is a probably a bad idea to accept NULL argument in
>> qobject_ref().
>
> Yes? What's the patch doing about it? Peeking ahead: it outlaws it.
> So say that.
>
ok, it's the patch title.
>> Furthermore,
>
> Commit message smell: two things in one patch. Worth separating them?
>
ok
>> it is convenient and more clear to call qobject_ref() at
>> the time when the reference is associated with a variable, or
>> argument. For this reason, make qobject_ref() return the same pointer
>> as given.
>
> Not 100% clear whether the patch merely makes the "convenient and more
> clear" way possible, or reality. Peeking ahead: it's the latter. So
> say that.
>
> How did you find the places to change?
manual review
> Do you think you got them all?
I think so
>
>> Signed-off-by: Marc-André Lureau <address@hidden>
>
--
Marc-André Lureau