From 2c530f79afb83ea52bb5e4d61ec2520ff8bc00ea Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 30 Dec 2019 04:38:51 +0000 Subject: [PATCH] scst: Use designated initializers for sys_alloc_fns Designated initializers are required for GCC to safely implement RANDSTRUCT, a GCC plugin pulled from the Grsecurity patch set upstream ~2017. Fix the compile error caused by implementation of sys_alloc_fns by rewriting the struct with designated members. See also https://github.com/bvanassche/scst/pull/17. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8759 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_mem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scst/src/scst_mem.c b/scst/src/scst_mem.c index b553d4ca5..a0bba7662 100644 --- a/scst/src/scst_mem.c +++ b/scst/src/scst_mem.c @@ -1253,7 +1253,9 @@ struct scatterlist *scst_alloc_sg(int size, gfp_t gfp_mask, int *count) struct scatterlist *res; int pages = PAGE_ALIGN(size) >> PAGE_SHIFT; struct sgv_pool_alloc_fns sys_alloc_fns = { - sgv_alloc_sys_pages, sgv_free_sys_sg_entries }; + .alloc_pages_fn = sgv_alloc_sys_pages, + .free_pages_fn = sgv_free_sys_sg_entries, + }; int no_fail = ((gfp_mask & __GFP_NOFAIL) == __GFP_NOFAIL); int cnt;