[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: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v4 4/4] qobject: modify qobject_ref() to assert on NULL and return obj |
Date: |
Mon, 16 Apr 2018 11:38:45 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Markus Armbruster <address@hidden> writes:
> 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.
>
>> Furthermore,
>
> Commit message smell: two things in one patch. Worth separating them?
>
>> 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?
Ah, you answered this during review of v3: manual review of
qobject_ref() uses.
> Do you think you got them all?
I guess that means you do.
>> Signed-off-by: Marc-André Lureau <address@hidden>