N NeilBrown #
Message details and related content
On Thu, 31 Jul 2014 16:47:35 -0700 Josh Triplett [off-list ref]
wrote:
Mark raid6_calls and other structures containing function pointers with __designated_init. Fix implementations in lib/raid6/ to use designated initializers; this also simplifies those initializers using the default initialization of fields to 0. Signed-off-by: Josh Triplett <redacted>
Looks like an excellent idea! Feel free to forward this upstream on my behalf, or remind me once the first patch is in -next, and I'll take this one myself - whichever you prefer. Acked-by: NeilBrown [off-list ref] Thanks, NeilBrown
quoted hunk
--- include/linux/raid/pq.h | 4 ++-- include/linux/raid/xor.h | 2 +- include/linux/raid_class.h | 2 +- lib/raid6/altivec.uc | 7 +++---- lib/raid6/avx2.c | 24 ++++++++++++------------ lib/raid6/int.uc | 6 ++---- lib/raid6/mmx.c | 14 ++++++-------- lib/raid6/neon.c | 7 +++---- lib/raid6/sse1.c | 16 ++++++++-------- lib/raid6/sse2.c | 24 ++++++++++++------------ lib/raid6/tilegx.uc | 6 ++---- 11 files changed, 52 insertions(+), 60 deletions(-)diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h index 73069cb..2147bff 100644 --- a/include/linux/raid/pq.h +++ b/include/linux/raid/pq.h@@ -75,7 +75,7 @@ struct raid6_calls { int (*valid)(void); /* Returns 1 if this routine set is usable */ const char *name; /* Name of this routine set */ int prefer; /* Has special performance attribute */ -}; +} __designated_init; /* Selected algorithm */ extern struct raid6_calls raid6_call;@@ -109,7 +109,7 @@ struct raid6_recov_calls { int (*valid)(void); const char *name; int priority; -}; +} __designated_init; extern const struct raid6_recov_calls raid6_recov_intx1; extern const struct raid6_recov_calls raid6_recov_ssse3;diff --git a/include/linux/raid/xor.h b/include/linux/raid/xor.h index 5a21095..c7df59f 100644 --- a/include/linux/raid/xor.h +++ b/include/linux/raid/xor.h