Re: [PATCH v2] resource: add a simple test for walk_iomem_res_desc()

From: Andy Shevchenko
Date: Wed Jun 05 2024 - 06:25:04 EST


On Tue, Jun 04, 2024 at 03:01:14PM -0700, Chia-I Wu wrote:
> This mainly tests that find_next_iomem_res() does not miss resources.

...

It's better, but still hard to follow, see below what I meant

> + res[0] = DEFINE_RES_NAMED(root.start, SZ_1K, "SYSRAM 1",
> + IORESOURCE_SYSTEM_RAM);
> + res[1] = DEFINE_RES_NAMED(root.start + SZ_1K, SZ_1K, "OTHER", 0);
> +
> + res[2] = DEFINE_RES_NAMED(root.start + SZ_1K * 3, SZ_1K, "NESTED", 0);
> + res[3] = DEFINE_RES_NAMED(root.start + SZ_1K * 3 + SZ_512, SZ_512,
> + "SYSRAM 2", IORESOURCE_SYSTEM_RAM);
> +
> + res[4] = DEFINE_RES_NAMED(root.start + SZ_1K * 4, SZ_1K, "SYSRAM 3",
> + IORESOURCE_SYSTEM_RAM);

res[0] = DEFINE_RES_NAMED(root.start + 0x0000, 0x0400, "SYSRAM 1",
IORESOURCE_SYSTEM_RAM);
res[1] = DEFINE_RES_NAMED(root.start + 0x0400, 0x0400, "OTHER", 0);

res[2] = DEFINE_RES_NAMED(root.start + 0x0c00, 0x0400, "NESTED", 0);
res[3] = DEFINE_RES_NAMED(root.start + 0x0e00, 0x0200, "SYSRAM 2",
IORESOURCE_SYSTEM_RAM);

res[4] = DEFINE_RES_NAMED(root.start + 0x1000, 0x0400, "SYSRAM 3",
IORESOURCE_SYSTEM_RAM);

Also pay attention to indentation.

--
With Best Regards,
Andy Shevchenko