[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [Qemu-devel] [PATCH 2/3] machine: Eliminate unnecessary
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [qemu-s390x] [Qemu-devel] [PATCH 2/3] machine: Eliminate unnecessary stringify() usage |
Date: |
Tue, 8 Jan 2019 15:36:51 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 |
On 1/7/19 8:30 PM, Eduardo Habkost wrote:
> stringify() is useful when we need to use macros in compat_props
> (like when we set virtio-baloon-pci.class=PCI_CLASS_MEMORY_RAM at
> pc_i440fx_1_0_machine_options()), but it is pointless when we are
> already providing a number literal.
>
> Replace stringify() with string literals when appropriate.
>
> Signed-off-by: Eduardo Habkost <address@hidden>
> ---
> hw/core/machine.c | 8 ++--
> hw/i386/pc.c | 94 +++++++++++++++++++++++------------------------
> hw/i386/pc_piix.c | 30 +++++++--------
> hw/ppc/spapr.c | 2 +-
> 4 files changed, 67 insertions(+), 67 deletions(-)
>
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index f8563efb86..4b4d6c23de 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -135,11 +135,11 @@ GlobalProperty hw_compat_2_8[] = {
> {
> .driver = "fw_cfg_mem",
> .property = "x-file-slots",
> - .value = stringify(0x10),
> + .value = "0x10",
[...]
Lovely.
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
- [qemu-s390x] [PATCH 0/3] machine: Make compat_props arrays shorter and more readable, Eduardo Habkost, 2019/01/07
- [qemu-s390x] [PATCH 1/3] spapr: Eliminate SPAPR_PCI_2_7_MMIO_WIN_SIZE macro, Eduardo Habkost, 2019/01/07
- [qemu-s390x] [PATCH 2/3] machine: Eliminate unnecessary stringify() usage, Eduardo Habkost, 2019/01/07
- [qemu-s390x] [PATCH 3/3] machine: Use shorter format for GlobalProperty arrays, Eduardo Habkost, 2019/01/07
- Re: [qemu-s390x] [PATCH 3/3] machine: Use shorter format for GlobalProperty arrays, Cornelia Huck, 2019/01/08
- Re: [qemu-s390x] [Qemu-devel] [PATCH 3/3] machine: Use shorter format for GlobalProperty arrays, Philippe Mathieu-Daudé, 2019/01/08