Skip to contentSkip to conversation

bootfdt: Add missing trailing commas in BOOTINFO_{ACPI,SHMEM}_INIT

PATCH In review Michal Orzel 3 participants 3 messages Dec 3, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bootfdt: Add missing trailing commas in BOOTINFO_{ACPI,SHMEM}_INIT

Commit a14593e3995a extended BOOTINFO_{ACPI,SHMEM}_INIT initializers
list with a new 'type' member but forgot to add trailing commas (they
were present before). This results in a build failure when building
with CONFIG_ACPI=y and CONFIG_STATIC_SHM=y:
./include/xen/bootfdt.h:155:5: error: request for member 'shmem' in something not a structure or union

  155 |     .shmem.common.max_banks = NR_SHMEM_BANKS,       \
      |     ^
./include/xen/bootfdt.h:168:5: note: in expansion of macro 'BOOTINFO_SHMEM_INIT'
  168 |     BOOTINFO_SHMEM_INIT                             \
      |     ^~~~~~~~~~~~~~~~~~~

common/device-tree/bootinfo.c:22:39: note: in expansion of macro 'BOOTINFO_INIT'
22 | struct bootinfo __initdata bootinfo = BOOTINFO_INIT;

Fixes a14593e3995a ("xen/device-tree: Allow region overlapping with /memreserve/ ranges")
---
 xen/include/xen/bootfdt.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xen/include/xen/bootfdt.h +2 -2
index cea40ee11706..343c48b73d2c 100644
@@ -145,7 +145,7 @@ struct bootinfo {
 #ifdef CONFIG_ACPI
 #define BOOTINFO_ACPI_INIT                          \
     .acpi.common.max_banks = NR_MEM_BANKS,          \
-    .acpi.common.type = MEMORY
+    .acpi.common.type = MEMORY,
 #else
 #define BOOTINFO_ACPI_INIT
 #endif
@@ -153,7 +153,7 @@ struct bootinfo {
 #ifdef CONFIG_STATIC_SHM
 #define BOOTINFO_SHMEM_INIT                         \
     .shmem.common.max_banks = NR_SHMEM_BANKS,       \
-    .shmem.common.type = STATIC_SHARED_MEMORY
+    .shmem.common.type = STATIC_SHARED_MEMORY,
 #else
 #define BOOTINFO_SHMEM_INIT
 #endif
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Michal,

Quoted 12 lines · Michal Orzel

Commit a14593e3995a extended BOOTINFO_{ACPI,SHMEM}_INIT initializers
list with a new 'type' member but forgot to add trailing commas (they
were present before). This results in a build failure when building
with CONFIG_ACPI=y and CONFIG_STATIC_SHM=y:
./include/xen/bootfdt.h:155:5: error: request for member 'shmem' in something not a structure or union

 155 |     .shmem.common.max_banks = NR_SHMEM_BANKS,       \
     |     ^
./include/xen/bootfdt.h:168:5: note: in expansion of macro 'BOOTINFO_SHMEM_INIT'
 168 |     BOOTINFO_SHMEM_INIT                             \
     |     ^~~~~~~~~~~~~~~~~~~
Quoted 5 lines

common/device-tree/bootinfo.c:22:39: note: in expansion of macro 'BOOTINFO_INIT'
22 | struct bootinfo __initdata bootinfo = BOOTINFO_INIT;

Fixes a14593e3995a ("xen/device-tree: Allow region overlapping with /memreserve/ ranges")

Cheers
Bertrand

Quoted 29 lines

---
xen/include/xen/bootfdt.h | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
xen/include/xen/bootfdt.h +2 -2
index cea40ee11706..343c48b73d2c 100644
@@ -145,7 +145,7 @@ struct bootinfo {
 #ifdef CONFIG_ACPI
 #define BOOTINFO_ACPI_INIT                          \
    .acpi.common.max_banks = NR_MEM_BANKS,          \
-    .acpi.common.type = MEMORY
+    .acpi.common.type = MEMORY,
 #else
 #define BOOTINFO_ACPI_INIT
 #endif
@@ -153,7 +153,7 @@ struct bootinfo {
 #ifdef CONFIG_STATIC_SHM
 #define BOOTINFO_SHMEM_INIT                         \
    .shmem.common.max_banks = NR_SHMEM_BANKS,       \
-    .shmem.common.type = STATIC_SHARED_MEMORY
+    .shmem.common.type = STATIC_SHARED_MEMORY,
 #else
 #define BOOTINFO_SHMEM_INIT
 #endif
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Michal Orzel
Quoted 14 lines · Michal Orzel

Commit a14593e3995a extended BOOTINFO_{ACPI,SHMEM}_INIT initializers
list with a new 'type' member but forgot to add trailing commas (they
were present before). This results in a build failure when building
with CONFIG_ACPI=y and CONFIG_STATIC_SHM=y:
./include/xen/bootfdt.h:155:5: error: request for member 'shmem' in something not a structure or union

 155 |     .shmem.common.max_banks = NR_SHMEM_BANKS,       \
     |     ^
./include/xen/bootfdt.h:168:5: note: in expansion of macro 'BOOTINFO_SHMEM_INIT'
 168 |     BOOTINFO_SHMEM_INIT                             \
     |     ^~~~~~~~~~~~~~~~~~~
Quoted 6 lines

common/device-tree/bootinfo.c:22:39: note: in expansion of macro 'BOOTINFO_INIT'
22 | struct bootinfo __initdata bootinfo = BOOTINFO_INIT;

Fixes a14593e3995a ("xen/device-tree: Allow region overlapping with /memreserve/ ranges")

---

Thanks Michal, I realise our internal CI is not testing a configuration with CONFIG_ACPI=y and CONFIG_STATIC_SHM=y, this is why I missed it.

Reviewed-by Luca Fancellu <[email protected] <mailto:[email protected]>>

Cheers,
Luca