All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cao jin <caoj.fnst@cn.fujitsu.com>
To: Michael Tokarev <mjt@tls.msk.ru>, <qemu-devel@nongnu.org>
Cc: qemu-trivial <qemu-trivial@nongnu.org>, kraxel@redhat.com
Subject: Re: [Qemu-trivial] [PATCH 1/2] Emulated CCID card: QOMify
Date: Tue, 2 Feb 2016 17:00:43 +0800	[thread overview]
Message-ID: <56B0703B.5050907@cn.fujitsu.com> (raw)
In-Reply-To: <56B0693E.5070302@msgid.tls.msk.ru>



On 02/02/2016 04:30 PM, Michael Tokarev wrote:
> 02.02.2016 11:25, Cao jin wrote:
>> On 02/02/2016 04:15 PM, Michael Tokarev wrote:
>>> Why did you move the type definition from .c to .h file?
>>> It is only referenced in .c, no?
> []
>> Yes, that type definition is referred only in .c for now, but we are not sure about it in the future, for better flexibility, I think put it into .h is better. http://wiki.qemu.org/QOMConventions also says:
>>
>> DO use TYPE_FOO constants, defined in a header if used in other parts of code
>
> The last words in this sentense makes sense, I think:
> "if used in other parts of the code".
>
> So I read it as 2-part suggestion:
>
> 1) use TYPE_foo constants instead of "literals", and
> 2) define them in a header file if used elsewhere too.
>
> The "future flexibility" is, in my opinion, questionable.
> If we'll use them in the future, we can always move the
> #define to the header file.  For now, there's no need
> to clutter the heade more, but there's a good reason
> to use the #define in the "home" .c file where this
> device is implemented, in all places where the device
> name is referenced.
>
> At least that's how I read this (somewhat ambiguous)
> suggestion in the wiki.
>
> Thanks,
>
> /mjt
>

leave it where it was is also fine by me, it is not late to move it to 
header file when it is certainly to be used in other parts. I will 
update it:)

-- 
Yours Sincerely,

Cao jin




WARNING: multiple messages have this Message-ID (diff)
From: Cao jin <caoj.fnst@cn.fujitsu.com>
To: Michael Tokarev <mjt@tls.msk.ru>, qemu-devel@nongnu.org
Cc: qemu-trivial <qemu-trivial@nongnu.org>, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/2] Emulated CCID card: QOMify
Date: Tue, 2 Feb 2016 17:00:43 +0800	[thread overview]
Message-ID: <56B0703B.5050907@cn.fujitsu.com> (raw)
In-Reply-To: <56B0693E.5070302@msgid.tls.msk.ru>



On 02/02/2016 04:30 PM, Michael Tokarev wrote:
> 02.02.2016 11:25, Cao jin wrote:
>> On 02/02/2016 04:15 PM, Michael Tokarev wrote:
>>> Why did you move the type definition from .c to .h file?
>>> It is only referenced in .c, no?
> []
>> Yes, that type definition is referred only in .c for now, but we are not sure about it in the future, for better flexibility, I think put it into .h is better. http://wiki.qemu.org/QOMConventions also says:
>>
>> DO use TYPE_FOO constants, defined in a header if used in other parts of code
>
> The last words in this sentense makes sense, I think:
> "if used in other parts of the code".
>
> So I read it as 2-part suggestion:
>
> 1) use TYPE_foo constants instead of "literals", and
> 2) define them in a header file if used elsewhere too.
>
> The "future flexibility" is, in my opinion, questionable.
> If we'll use them in the future, we can always move the
> #define to the header file.  For now, there's no need
> to clutter the heade more, but there's a good reason
> to use the #define in the "home" .c file where this
> device is implemented, in all places where the device
> name is referenced.
>
> At least that's how I read this (somewhat ambiguous)
> suggestion in the wiki.
>
> Thanks,
>
> /mjt
>

leave it where it was is also fine by me, it is not late to move it to 
header file when it is certainly to be used in other parts. I will 
update it:)

-- 
Yours Sincerely,

Cao jin

  reply	other threads:[~2016-02-02  9:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01  6:53 [Qemu-devel] [PATCH 0/2] CCID QOMify Cao jin
2016-02-01  6:53 ` [Qemu-devel] [PATCH 1/2] Emulated CCID card: QOMify Cao jin
2016-02-02  8:15   ` [Qemu-trivial] " Michael Tokarev
2016-02-02  8:15     ` [Qemu-devel] " Michael Tokarev
2016-02-02  8:25     ` [Qemu-trivial] " Cao jin
2016-02-02  8:25       ` [Qemu-devel] " Cao jin
2016-02-02  8:30       ` [Qemu-trivial] " Michael Tokarev
2016-02-02  8:30         ` [Qemu-devel] " Michael Tokarev
2016-02-02  9:00         ` Cao jin [this message]
2016-02-02  9:00           ` Cao jin
2016-02-01  6:53 ` [Qemu-devel] [PATCH 2/2] Passthru " Cao jin
2016-02-02  8:05 ` [Qemu-trivial] [Qemu-devel] [PATCH 0/2] CCID QOMify Cao jin
2016-02-02  8:05   ` Cao jin

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=56B0703B.5050907@cn.fujitsu.com \
    --to=caoj.fnst@cn.fujitsu.com \
    --cc=kraxel@redhat.com \
    --cc=mjt@tls.msk.ru \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.