qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cao jin <caoj.fnst@cn.fujitsu.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: ehabkost@redhat.com, mst@redhat.com, qemu-trivial@nongnu.org,
	qemu-devel@nongnu.org, pbonzini@redhat.com, rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH v2] Use macro instead of plain text
Date: Sun, 20 Dec 2015 18:09:04 +0800	[thread overview]
Message-ID: <56767E40.9090607@cn.fujitsu.com> (raw)
In-Reply-To: <87wpsbex5u.fsf@blackfin.pond.sub.org>



On 12/18/2015 08:52 PM, Markus Armbruster wrote:
> Cao jin <caoj.fnst@cn.fujitsu.com> writes:
>
>> There is TYPE_ICH9_AHCI definition in ahci.h when QOMify it, seems it
>> is missed.
>>
>> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
>> ---
>>   hw/i386/pc_q35.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
>> index 9a12068..aa34a07 100644
>> --- a/hw/i386/pc_q35.c
>> +++ b/hw/i386/pc_q35.c
>> @@ -249,7 +249,7 @@ static void pc_q35_init(MachineState *machine)
>>       ahci = pci_create_simple_multifunction(host_bus,
>>                                              PCI_DEVFN(ICH9_SATA1_DEV,
>>                                                        ICH9_SATA1_FUNC),
>> -                                           true, "ich9-ahci");
>> +                                           true, TYPE_ICH9_AHCI);
>>       idebus[0] = qdev_get_child_bus(&ahci->qdev, "ide.0");
>>       idebus[1] = qdev_get_child_bus(&ahci->qdev, "ide.1");
>>       g_assert(MAX_SATA_PORTS == ICH_AHCI(ahci)->ahci.ports);
>
> I suspect there are more instances of the same problem.
>
> To find all similar macro definitions:
>
>      $ git-grep -Eh '^ *# *define +TYPE_[A-Za-z0-9_]+ +"'
>
> Extract the strings:
>
>      $ git-grep -Eh '^ *# *define +TYPE_[A-Za-z0-9_]+ +"' | sed 's/^[^"]*\("[^"]*"\).*/\1/'
>
> Search the source for them:
>
>      $ for i in `git-grep -Eh '^ *# *define +TYPE_[A-Za-z0-9_]+ +"' | sed 's/^[^"]*\("[^"]*"\).*/\1/'`; do echo "= $i ="; git-grep -F "$i"; done
>
> Results in more than 1000 hits for me.  Names like "device" are of
> course very prone to false positives.
>

Yes, often seeing "plain text" style when browsing code, and after 
seeing PMM`s explanation, I finally see why there are lots of these...

> Not sure how interested we are in consistent use of these macros...
>

I didn`t pay any attention to this before. It comes to me when I make 
the V2 "msi/msix" patch. as I said in that cover-letter: special case:)

we can forget this patch now.

>
> .
>

-- 
Yours Sincerely,

Cao Jin

      parent reply	other threads:[~2015-12-20 10:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-18  8:52 [Qemu-devel] [PATCH v2] Use macro instead of plain text Cao jin
2015-12-18 12:52 ` Markus Armbruster
2015-12-18 13:01   ` Peter Maydell
2015-12-20 10:16     ` Cao jin
2015-12-20 10:09   ` 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=56767E40.9090607@cn.fujitsu.com \
    --to=caoj.fnst@cn.fujitsu.com \
    --cc=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=rth@twiddle.net \
    /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).