qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Nabih Estefan <nabihestefan@google.com>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, kfting@nuvoton.com,
	 wuhaotsh@google.com, jasowang@redhat.com,
	avi.fishman@nuvoton.com,  kwliu@nuvoton.com,
	tomer.maimon@nuvoton.com, Hila.Miranda-Kuzi@nuvoton.com
Subject: Re: [PATCH v8 11/11] tests/qtest: Adding PCS Module test to GMAC Qtest
Date: Mon, 18 Dec 2023 14:43:01 +0000	[thread overview]
Message-ID: <CAFEAcA8H1-Sj34mdOQyoc_7Ut-e5DEKbX8MN4DSxZkxABDGDCQ@mail.gmail.com> (raw)
In-Reply-To: <20231214211527.1946302-12-nabihestefan@google.com>

On Thu, 14 Dec 2023 at 21:15, Nabih Estefan <nabihestefan@google.com> wrote:
>
> From: Nabih Estefan Diaz <nabihestefan@google.com>
>
>  - Add PCS Register check to npcm_gmac-test
>
> Signed-off-by: Nabih Estefan <nabihestefan@google.com>
> Reviewed-by: Tyrone Ting <kfting@nuvoton.com>
> ---



> @@ -129,7 +198,12 @@ static void test_init(gconstpointer test_data)
>  #define CHECK_REG32(regno, value) \
>      do { \
>          g_assert_cmphex(gmac_read(qts, mod, (regno)), ==, (value)); \
> -    } while (0)
> +    } while (0) ;
> +
> +#define CHECK_REG_PCS(regno, value) \
> +    do { \
> +        g_assert_cmphex(pcs_read(qts, mod, (regno)), ==, (value)); \
> +    } while (0) ;

The standard way to write this kind of do {...} while (0)
macro does not have a ';' at the end of the definition.
That's the whole point of the idiom -- it means the macro
expands to a single C statement, so it does the right thing
if you write
  if CHECK_REG_PCS(x,y)
      goto foo;
without braces. You got this right with CHECK_REG32(), but
then this patch (a) incorrectly adds the extra ';' to it
and (b) has a ';' after the new macro.


>      CHECK_REG32(NPCM_DMA_BUS_MODE, 0x00020100);
>      CHECK_REG32(NPCM_DMA_XMT_POLL_DEMAND, 0);
> @@ -180,6 +254,64 @@ static void test_init(gconstpointer test_data)
>      CHECK_REG32(NPCM_GMAC_PTP_TAR, 0);
>      CHECK_REG32(NPCM_GMAC_PTP_TTSR, 0);
>
> +    /* TODO Add registers PCS */
> +    if (mod->base_addr == 0xf0802000) {
> +        CHECK_REG_PCS(NPCM_PCS_SR_CTL_ID1, 0x699e)
> +        CHECK_REG_PCS(NPCM_PCS_SR_CTL_ID2, 0)

These should all have a trailing ';' like the CHECK_REG32()
invocations. This makes them look like function calls
syntax-wise, which is nice for things like editor code
indentation.

thanks
-- PMM


      reply	other threads:[~2023-12-18 14:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-14 21:15 [PATCH v8 00/11] Implementation of NPI Mailbox and GMAC Networking Module Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 01/11] hw/misc: Add Nuvoton's PCI Mailbox Module Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 02/11] hw/arm: Add PCI mailbox module to Nuvoton SoC Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 03/11] hw/misc: Add qtest for NPCM7xx PCI Mailbox Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 04/11] hw/net: Add NPCMXXX GMAC device Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 05/11] hw/arm: Add GMAC devices to NPCM7XX SoC Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 06/11] tests/qtest: Creating qtest for GMAC Module Nabih Estefan
2023-12-18 14:28   ` Peter Maydell
2023-12-14 21:15 ` [PATCH v8 07/11] include/hw/net: Implemented Classes and Masks for GMAC Descriptors Nabih Estefan
2023-12-18 14:36   ` Peter Maydell
2023-12-14 21:15 ` [PATCH v8 08/11] hw/net: General GMAC Implementation Nabih Estefan
2023-12-18 14:38   ` Peter Maydell
2023-12-14 21:15 ` [PATCH v8 09/11] hw/net: GMAC Rx Implementation Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 10/11] hw/net: GMAC Tx Implementation Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 11/11] tests/qtest: Adding PCS Module test to GMAC Qtest Nabih Estefan
2023-12-18 14:43   ` Peter Maydell [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=CAFEAcA8H1-Sj34mdOQyoc_7Ut-e5DEKbX8MN4DSxZkxABDGDCQ@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=Hila.Miranda-Kuzi@nuvoton.com \
    --cc=avi.fishman@nuvoton.com \
    --cc=jasowang@redhat.com \
    --cc=kfting@nuvoton.com \
    --cc=kwliu@nuvoton.com \
    --cc=nabihestefan@google.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=tomer.maimon@nuvoton.com \
    --cc=wuhaotsh@google.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).