qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] Use macro instead of plain text


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v2] Use macro instead of plain text
Date: Fri, 18 Dec 2015 13:52:45 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Cao jin <address@hidden> writes:

> There is TYPE_ICH9_AHCI definition in ahci.h when QOMify it, seems it
> is missed.
>
> Signed-off-by: Cao jin <address@hidden>
> ---
>  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.

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]