From: Cao jin <caoj.fnst@cn.fujitsu.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "QEMU Trivial" <qemu-trivial@nongnu.org>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH] qom/object: fix 2 comment typos
Date: Tue, 3 Nov 2015 09:38:27 +0800 [thread overview]
Message-ID: <56381013.4030304@cn.fujitsu.com> (raw)
In-Reply-To: <CAFEAcA_FnN9a3Kc_izXOSGYH_7JXy3qfww0h40tGuPZ8krN0eQ@mail.gmail.com>
On 11/02/2015 07:34 PM, Peter Maydell wrote:
> On 2 November 2015 at 09:04, Cao jin <caoj.fnst@cn.fujitsu.com> wrote:
>> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
>> ---
>> include/qom/object.h | 2 +-
>> qom/object.c | 2 +-
>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/qom/object.h b/include/qom/object.h
>> index be7280c..9e5162a 100644
>> --- a/include/qom/object.h
>> +++ b/include/qom/object.h
>> @@ -511,7 +511,7 @@ struct TypeInfo
>> /**
>> * OBJECT_CLASS_CHECK:
>> * @class: The C type to use for the return value.
>> - * @obj: A derivative of @type to cast.
>> + * @obj: A derivative class of @class to cast.
>> * @name: the QOM typename of @class.
>
> I think this is right but not sufficient. Since OBJECT_CLASS_CHECK's
> second parameter is not an object but a class, the name "obj" is
> rather misleading and should be changed. My suggestion would be
> to use
>
> * @classtype: The C type to use for the return value.
> * @class: A derivative class of @classtype to cast.
> * @name: the QOM typename of @class.
>
> (and the macro definition parameter names should change to match).
>
Yes, Agree. The comment seems just a copy of macro OBJECT_CHECK`s. Will
modify it in v2:)
>> *
>> * A type safe version of @object_class_dynamic_cast_assert. This macro is
>> diff --git a/qom/object.c b/qom/object.c
>> index 11cd86b..fc6e161 100644
>> --- a/qom/object.c
>> +++ b/qom/object.c
>> @@ -204,7 +204,7 @@ static bool type_is_ancestor(TypeImpl *type, TypeImpl *target_type)
>> {
>> assert(target_type);
>>
>> - /* Check if typename is a direct ancestor of type */
>> + /* Check if target_type is a direct ancestor of type */
>> while (type) {
>> if (type == target_type) {
>> return true;
>
> This change is good.
>
> thanks
> -- PMM
>
--
Yours Sincerely,
Cao Jin
prev parent reply other threads:[~2015-11-03 7:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-02 9:04 [Qemu-devel] [PATCH] qom/object: fix 2 comment typos Cao jin
2015-11-02 11:34 ` Peter Maydell
2015-11-03 1:38 ` Cao jin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56381013.4030304@cn.fujitsu.com \
--to=caoj.fnst@cn.fujitsu.com \
--cc=afaerber@suse.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).