qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
	qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com,
	bmeng@tinylab.org, liweiwei@iscas.ac.cn,
	zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com
Subject: Re: [PATCH for-8.2 v2 5/7] target/riscv/cpu.c: add a ADD_CPU_PROPERTIES_ARRAY() macro
Date: Thu, 13 Jul 2023 21:40:56 +0100	[thread overview]
Message-ID: <9626ed95-9d50-344b-696a-95998e98e3f4@linaro.org> (raw)
In-Reply-To: <20230712205748.446931-6-dbarboza@ventanamicro.com>

On 7/12/23 21:57, Daniel Henrique Barboza wrote:
> +#define ADD_CPU_PROPERTIES_ARRAY(_dev, _array) \
> +    for (prop = _array; prop && prop->name; prop++) { \
> +        qdev_property_add_static(_dev, prop); \
> +    } \

do { } while(0)

Watch the \ on the last line of the macro.
Declare the iterator within the macro, rather than use one defined in the outer scope.
Why not use ARRAY_SIZE?


r~


  reply	other threads:[~2023-07-13 20:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 20:57 [PATCH for-8.2 v2 0/7] target/riscv: add 'max' CPU type Daniel Henrique Barboza
2023-07-12 20:57 ` [PATCH for-8.2 v2 1/7] target/riscv/cpu.c: split CPU options from riscv_cpu_extensions[] Daniel Henrique Barboza
2023-07-14  3:13   ` Alistair Francis
2023-07-12 20:57 ` [PATCH for-8.2 v2 2/7] target/riscv/cpu.c: skip 'bool' check when filtering KVM props Daniel Henrique Barboza
2023-07-14  3:15   ` Alistair Francis
2023-07-12 20:57 ` [PATCH for-8.2 v2 3/7] target/riscv/cpu.c: split vendor exts from riscv_cpu_extensions[] Daniel Henrique Barboza
2023-07-14  3:14   ` Alistair Francis
2023-07-12 20:57 ` [PATCH for-8.2 v2 4/7] target/riscv/cpu.c: split non-ratified " Daniel Henrique Barboza
2023-07-14  3:15   ` Alistair Francis
2023-07-12 20:57 ` [PATCH for-8.2 v2 5/7] target/riscv/cpu.c: add a ADD_CPU_PROPERTIES_ARRAY() macro Daniel Henrique Barboza
2023-07-13 20:40   ` Richard Henderson [this message]
2023-07-13 21:27     ` Daniel Henrique Barboza
2023-07-14  6:30       ` Richard Henderson
2023-07-12 20:57 ` [PATCH for-8.2 v2 6/7] target/riscv: add 'max' CPU type Daniel Henrique Barboza
2023-07-14  3:10   ` Alistair Francis
2023-07-12 20:57 ` [PATCH for-8.2 v2 7/7] avocado, risc-v: add opensbi tests for 'max' CPU Daniel Henrique Barboza

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=9626ed95-9d50-344b-696a-95998e98e3f4@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=bmeng@tinylab.org \
    --cc=dbarboza@ventanamicro.com \
    --cc=liweiwei@iscas.ac.cn \
    --cc=palmer@rivosinc.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=zhiwei_liu@linux.alibaba.com \
    /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).