]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
raid6: use named initializers for struct raid6_calls
authorChristoph Hellwig <hch@lst.de>
Mon, 18 May 2026 05:17:49 +0000 (07:17 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 29 May 2026 04:24:53 +0000 (21:24 -0700)
Link: https://lore.kernel.org/20260518051804.462141-7-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Ard Biesheuvel <ardb@kernel.org> # kunit only on arm64
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "Borislav Petkov (AMD)" <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chris Mason <clm@fb.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: David Sterba <dsterba@suse.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Li Nan <linan122@huawei.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Song Liu <song@kernel.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 files changed:
lib/raid/raid6/arm/neon.c
lib/raid/raid6/int.uc
lib/raid/raid6/loongarch/loongarch_simd.c
lib/raid/raid6/powerpc/altivec.uc
lib/raid/raid6/powerpc/vpermxor.uc
lib/raid/raid6/riscv/rvv.h
lib/raid/raid6/s390/s390vx.uc
lib/raid/raid6/x86/avx2.c
lib/raid/raid6/x86/avx512.c
lib/raid/raid6/x86/mmx.c
lib/raid/raid6/x86/sse1.c
lib/raid/raid6/x86/sse2.c

index 47b8bb0afc65f9c24d76d03c1a56c060ee225621..c21da59ab48f7a4bbe69a9742448f3303f53b925 100644 (file)
                                start, stop, (unsigned long)bytes, ptrs);\
        }                                                               \
        struct raid6_calls const raid6_neonx ## _n = {                  \
-               raid6_neon ## _n ## _gen_syndrome,                      \
-               raid6_neon ## _n ## _xor_syndrome,                      \
-               raid6_have_neon,                                        \
-               "neonx" #_n,                                            \
-               0                                                       \
+               .gen_syndrome   = raid6_neon ## _n ## _gen_syndrome,    \
+               .xor_syndrome   = raid6_neon ## _n ## _xor_syndrome,    \
+               .valid          = raid6_have_neon,                      \
+               .name           = "neonx" #_n,                          \
        }
 
 static int raid6_have_neon(void)
index 1ba56c3fa482526c257bfa7b85da85ac028a3340..4f5f2869e21e1db89412e0282791cccecf50c37c 100644 (file)
@@ -139,9 +139,7 @@ static void raid6_int$#_xor_syndrome(int disks, int start, int stop,
 }
 
 const struct raid6_calls raid6_intx$# = {
-       raid6_int$#_gen_syndrome,
-       raid6_int$#_xor_syndrome,
-       NULL,                   /* always valid */
-       "int" NSTRING "x$#",
-       0
+       .gen_syndrome   = raid6_int$#_gen_syndrome,
+       .xor_syndrome   = raid6_int$#_xor_syndrome,
+       .name           = "int" NSTRING "x$#",
 };
index 72f4d92d4876d6bbf420fb5ae30aa273a35192e7..1b4cd1512d055d58cf2750e0a544b4987b90ae3f 100644 (file)
@@ -244,11 +244,10 @@ static void raid6_lsx_xor_syndrome(int disks, int start, int stop,
 }
 
 const struct raid6_calls raid6_lsx = {
-       raid6_lsx_gen_syndrome,
-       raid6_lsx_xor_syndrome,
-       raid6_has_lsx,
-       "lsx",
-       .priority = 0 /* see the comment near the top of the file for reason */
+       .gen_syndrome   = raid6_lsx_gen_syndrome,
+       .xor_syndrome   = raid6_lsx_xor_syndrome,
+       .valid          = raid6_has_lsx,
+       .name           = "lsx",
 };
 
 #undef NSIZE
@@ -413,11 +412,10 @@ static void raid6_lasx_xor_syndrome(int disks, int start, int stop,
 }
 
 const struct raid6_calls raid6_lasx = {
-       raid6_lasx_gen_syndrome,
-       raid6_lasx_xor_syndrome,
-       raid6_has_lasx,
-       "lasx",
-       .priority = 0 /* see the comment near the top of the file for reason */
+       .gen_syndrome   = raid6_lasx_gen_syndrome,
+       .xor_syndrome   = raid6_lasx_xor_syndrome,
+       .valid          = raid6_has_lasx,
+       .name           = "lasx",
 };
 #undef NSIZE
 #endif /* CONFIG_CPU_HAS_LASX */
index 130d3d3dd42c0b7cd6c5a8c5312ec6980d5499de..084ead768ddb0d8826a6a46de18b6ad8411d7472 100644 (file)
@@ -114,9 +114,7 @@ int raid6_have_altivec(void)
 #endif
 
 const struct raid6_calls raid6_altivec$# = {
-       raid6_altivec$#_gen_syndrome,
-       NULL,                   /* XOR not yet implemented */
-       raid6_have_altivec,
-       "altivecx$#",
-       0
+       .gen_syndrome   = raid6_altivec$#_gen_syndrome,
+       .valid          = raid6_have_altivec,
+       .name           = "altivecx$#",
 };
index 595f20aaf4cf78e87ccd6fdf1d9826577d0f665f..bb2c3a316ae8c4287ce7e7fb7fbe90b4e1db3b05 100644 (file)
@@ -87,9 +87,7 @@ int raid6_have_altivec_vpermxor(void)
 #endif
 
 const struct raid6_calls raid6_vpermxor$# = {
-       raid6_vpermxor$#_gen_syndrome,
-       NULL,
-       raid6_have_altivec_vpermxor,
-       "vpermxor$#",
-       0
+       .gen_syndrome   = raid6_vpermxor$#_gen_syndrome,
+       .valid          = raid6_have_altivec_vpermxor,
+       .name           = "vpermxor$#",
 };
index b0a71b375962c563859d6ead6e194076ce037c6b..0d430a4c5f08ab2a0dda684f55f162f822d15b53 100644 (file)
@@ -39,9 +39,8 @@ static int rvv_has_vector(void)
                kernel_vector_end();                                    \
        }                                                               \
        struct raid6_calls const raid6_rvvx ## _n = {                   \
-               raid6_rvv ## _n ## _gen_syndrome,                       \
-               raid6_rvv ## _n ## _xor_syndrome,                       \
-               rvv_has_vector,                                         \
-               "rvvx" #_n,                                             \
-               0                                                       \
+               .gen_syndrome   = raid6_rvv ## _n ## _gen_syndrome,     \
+               .xor_syndrome   = raid6_rvv ## _n ## _xor_syndrome,     \
+               .valid          = rvv_has_vector,                       \
+               .name           = "rvvx" #_n,                           \
        }
index 8aa53eb2f3958ce049fa2e1b035bcb32a3e14de7..97c5d5d9dcf94b267d21c93616e75244b15d16d7 100644 (file)
@@ -127,9 +127,9 @@ static int raid6_s390vx$#_valid(void)
 }
 
 const struct raid6_calls raid6_s390vx$# = {
-       raid6_s390vx$#_gen_syndrome,
-       raid6_s390vx$#_xor_syndrome,
-       raid6_s390vx$#_valid,
-       "vx128x$#",
-       1
+       .gen_syndrome   = raid6_s390vx$#_gen_syndrome,
+       .xor_syndrome   = raid6_s390vx$#_xor_syndrome,
+       .valid          = raid6_s390vx$#_valid,
+       .name           = "vx128x$#",
+       .priority       = 1,
 };
index a1a5213918af85937ade9b0028e2524aedd60e64..aab8b624c635a1f7360282beb157af36b83c24ae 100644 (file)
@@ -128,11 +128,12 @@ static void raid6_avx21_xor_syndrome(int disks, int start, int stop,
 }
 
 const struct raid6_calls raid6_avx2x1 = {
-       raid6_avx21_gen_syndrome,
-       raid6_avx21_xor_syndrome,
-       raid6_have_avx2,
-       "avx2x1",
-       .priority = 2           /* Prefer AVX2 over priority 1 (SSE2 and others) */
+       .gen_syndrome   = raid6_avx21_gen_syndrome,
+       .xor_syndrome   = raid6_avx21_xor_syndrome,
+       .valid          = raid6_have_avx2,
+       .name           = "avx2x1",
+       /* Prefer AVX2 over priority 1 (SSE2 and others) */
+       .priority       = 2,
 };
 
 /*
@@ -258,11 +259,12 @@ static void raid6_avx22_xor_syndrome(int disks, int start, int stop,
 }
 
 const struct raid6_calls raid6_avx2x2 = {
-       raid6_avx22_gen_syndrome,
-       raid6_avx22_xor_syndrome,
-       raid6_have_avx2,
-       "avx2x2",
-       .priority = 2           /* Prefer AVX2 over priority 1 (SSE2 and others) */
+       .gen_syndrome   = raid6_avx22_gen_syndrome,
+       .xor_syndrome   = raid6_avx22_xor_syndrome,
+       .valid          = raid6_have_avx2,
+       .name           = "avx2x2",
+       /* Prefer AVX2 over priority 1 (SSE2 and others) */
+       .priority       = 2,
 };
 
 #ifdef CONFIG_X86_64
@@ -461,10 +463,11 @@ static void raid6_avx24_xor_syndrome(int disks, int start, int stop,
 }
 
 const struct raid6_calls raid6_avx2x4 = {
-       raid6_avx24_gen_syndrome,
-       raid6_avx24_xor_syndrome,
-       raid6_have_avx2,
-       "avx2x4",
-       .priority = 2           /* Prefer AVX2 over priority 1 (SSE2 and others) */
+       .gen_syndrome   = raid6_avx24_gen_syndrome,
+       .xor_syndrome   = raid6_avx24_xor_syndrome,
+       .valid          = raid6_have_avx2,
+       .name           = "avx2x4",
+       /* Prefer AVX2 over priority 1 (SSE2 and others) */
+       .priority       = 2,
 };
 #endif /* CONFIG_X86_64 */
index 874998bcd7d78ce4336ab95e6fcf0a014a98cf85..47636b16632fa077b2231372bce523d03fd65e66 100644 (file)
@@ -156,11 +156,12 @@ static void raid6_avx5121_xor_syndrome(int disks, int start, int stop,
 }
 
 const struct raid6_calls raid6_avx512x1 = {
-       raid6_avx5121_gen_syndrome,
-       raid6_avx5121_xor_syndrome,
-       raid6_have_avx512,
-       "avx512x1",
-       .priority = 2           /* Prefer AVX512 over priority 1 (SSE2 and others) */
+       .gen_syndrome   = raid6_avx5121_gen_syndrome,
+       .xor_syndrome   = raid6_avx5121_xor_syndrome,
+       .valid          = raid6_have_avx512,
+       .name           = "avx512x1",
+       /* Prefer AVX512 over priority 1 (SSE2 and others) */
+       .priority       = 2,
 };
 
 /*
@@ -313,11 +314,12 @@ static void raid6_avx5122_xor_syndrome(int disks, int start, int stop,
 }
 
 const struct raid6_calls raid6_avx512x2 = {
-       raid6_avx5122_gen_syndrome,
-       raid6_avx5122_xor_syndrome,
-       raid6_have_avx512,
-       "avx512x2",
-       .priority = 2           /* Prefer AVX512 over priority 1 (SSE2 and others) */
+       .gen_syndrome   = raid6_avx5122_gen_syndrome,
+       .xor_syndrome   = raid6_avx5122_xor_syndrome,
+       .valid          = raid6_have_avx512,
+       .name           = "avx512x2",
+       /* Prefer AVX512 over priority 1 (SSE2 and others) */
+       .priority       = 2,
 };
 
 #ifdef CONFIG_X86_64
@@ -551,10 +553,11 @@ static void raid6_avx5124_xor_syndrome(int disks, int start, int stop,
        kernel_fpu_end();
 }
 const struct raid6_calls raid6_avx512x4 = {
-       raid6_avx5124_gen_syndrome,
-       raid6_avx5124_xor_syndrome,
-       raid6_have_avx512,
-       "avx512x4",
-       .priority = 2           /* Prefer AVX512 over priority 1 (SSE2 and others) */
+       .gen_syndrome   = raid6_avx5124_gen_syndrome,
+       .xor_syndrome   = raid6_avx5124_xor_syndrome,
+       .valid          = raid6_have_avx512,
+       .name           = "avx512x4",
+       /* Prefer AVX512 over priority 1 (SSE2 and others) */
+       .priority       = 2,
 };
 #endif
index 7e9810669347d5ee08e684ba77174ee0aff671f1..22b9fdaa705fca79e7784cc081cebb07c2cd4b02 100644 (file)
@@ -68,11 +68,9 @@ static void raid6_mmx1_gen_syndrome(int disks, size_t bytes, void **ptrs)
 }
 
 const struct raid6_calls raid6_mmxx1 = {
-       raid6_mmx1_gen_syndrome,
-       NULL,                   /* XOR not yet implemented */
-       raid6_have_mmx,
-       "mmxx1",
-       0
+       .gen_syndrome   = raid6_mmx1_gen_syndrome,
+       .valid          = raid6_have_mmx,
+       .name           = "mmxx1",
 };
 
 /*
@@ -127,9 +125,7 @@ static void raid6_mmx2_gen_syndrome(int disks, size_t bytes, void **ptrs)
 }
 
 const struct raid6_calls raid6_mmxx2 = {
-       raid6_mmx2_gen_syndrome,
-       NULL,                   /* XOR not yet implemented */
-       raid6_have_mmx,
-       "mmxx2",
-       0
+       .gen_syndrome   = raid6_mmx2_gen_syndrome,
+       .valid          = raid6_have_mmx,
+       .name           = "mmxx2",
 };
index deecdd72ceec152e2c98f4c34f6e26afdba31e18..fad214a430d8b8b76e9dfe485f460ecf6317f615 100644 (file)
@@ -84,11 +84,10 @@ static void raid6_sse11_gen_syndrome(int disks, size_t bytes, void **ptrs)
 }
 
 const struct raid6_calls raid6_sse1x1 = {
-       raid6_sse11_gen_syndrome,
-       NULL,                   /* XOR not yet implemented */
-       raid6_have_sse1_or_mmxext,
-       "sse1x1",
-       1                       /* Has cache hints */
+       .gen_syndrome   = raid6_sse11_gen_syndrome,
+       .valid          = raid6_have_sse1_or_mmxext,
+       .name           = "sse1x1",
+       .priority       = 1,    /* Has cache hints */
 };
 
 /*
@@ -147,9 +146,8 @@ static void raid6_sse12_gen_syndrome(int disks, size_t bytes, void **ptrs)
 }
 
 const struct raid6_calls raid6_sse1x2 = {
-       raid6_sse12_gen_syndrome,
-       NULL,                   /* XOR not yet implemented */
-       raid6_have_sse1_or_mmxext,
-       "sse1x2",
-       1                       /* Has cache hints */
+       .gen_syndrome   = raid6_sse12_gen_syndrome,
+       .valid          = raid6_have_sse1_or_mmxext,
+       .name           = "sse1x2",
+       .priority       = 1,    /* Has cache hints */
 };
index f9edf8a8d1c4281ae879df1e00e9045aec5f6639..1b28e858a1d4c260455b21a84ec48de16f3a39c6 100644 (file)
@@ -133,11 +133,11 @@ static void raid6_sse21_xor_syndrome(int disks, int start, int stop,
 }
 
 const struct raid6_calls raid6_sse2x1 = {
-       raid6_sse21_gen_syndrome,
-       raid6_sse21_xor_syndrome,
-       raid6_have_sse2,
-       "sse2x1",
-       1                       /* Has cache hints */
+       .gen_syndrome   = raid6_sse21_gen_syndrome,
+       .xor_syndrome   = raid6_sse21_xor_syndrome,
+       .valid          = raid6_have_sse2,
+       .name           = "sse2x1",
+       .priority       = 1,    /* Has cache hints */
 };
 
 /*
@@ -263,11 +263,11 @@ static void raid6_sse22_xor_syndrome(int disks, int start, int stop,
 }
 
 const struct raid6_calls raid6_sse2x2 = {
-       raid6_sse22_gen_syndrome,
-       raid6_sse22_xor_syndrome,
-       raid6_have_sse2,
-       "sse2x2",
-       1                       /* Has cache hints */
+       .gen_syndrome   = raid6_sse22_gen_syndrome,
+       .xor_syndrome   = raid6_sse22_xor_syndrome,
+       .valid          = raid6_have_sse2,
+       .name           = "sse2x2",
+       .priority       = 1,    /* Has cache hints */
 };
 
 #ifdef CONFIG_X86_64
@@ -470,11 +470,11 @@ static void raid6_sse24_xor_syndrome(int disks, int start, int stop,
 
 
 const struct raid6_calls raid6_sse2x4 = {
-       raid6_sse24_gen_syndrome,
-       raid6_sse24_xor_syndrome,
-       raid6_have_sse2,
-       "sse2x4",
-       1                       /* Has cache hints */
+       .gen_syndrome   = raid6_sse24_gen_syndrome,
+       .xor_syndrome   = raid6_sse24_xor_syndrome,
+       .valid          = raid6_have_sse2,
+       .name           = "sse2x4",
+       .priority       = 1,    /* Has cache hints */
 };
 
 #endif /* CONFIG_X86_64 */