kernel: fix jffs2 compilation with GCC_PLUGIN_RANDSTRUCT enabled
authorMatt Merhar <mattmerhar@protonmail.com>
Sun, 29 Oct 2023 01:15:46 +0000 (21:15 -0400)
committerMatt Merhar <mattmerhar@protonmail.com>
Sun, 29 Oct 2023 01:17:16 +0000 (21:17 -0400)
Designated initializers are required when using the randstruct GCC
plugin, otherwise an error like the following is seen:

./include/linux/lzma.h:60:31: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]

This was originally applied via 55643e469c21, but was unintentionally
reverted in 483503603cb2.

Fixes: 483503603cb2 ("generic: 5.15: rework pending patch")
Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
target/linux/generic/pending-5.15/530-jffs2_make_lzma_available.patch
target/linux/generic/pending-6.1/530-jffs2_make_lzma_available.patch

index ac784d0b0bb73df474f6c59c96391343f5bea73c..f236657b71602bee30a6921ac2c8b509ecf8b09f 100644 (file)
@@ -351,7 +351,7 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
 +              LZMA_FREE(address);
 +}
 +
-+static ISzAlloc lzma_alloc = {p_lzma_malloc, p_lzma_free};
++static ISzAlloc lzma_alloc = { .Alloc = p_lzma_malloc, .Free = p_lzma_free };
 +
 +#endif
 --- /dev/null
index f17216c52b9aea51f8fc51fe8d78b563a7050bec..27a673399a836f460b6e560b14ebce44ec8d1d4d 100644 (file)
@@ -351,7 +351,7 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
 +              LZMA_FREE(address);
 +}
 +
-+static ISzAlloc lzma_alloc = {p_lzma_malloc, p_lzma_free};
++static ISzAlloc lzma_alloc = { .Alloc = p_lzma_malloc, .Free = p_lzma_free };
 +
 +#endif
 --- /dev/null