]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm-mempolicy-convert-from-atomic_t-to-refcount_t-on-mempolicy-refcnt-fix
authorAndrew Morton <akpm@linux-foundation.org>
Mon, 23 Aug 2021 23:59:34 +0000 (09:59 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:34:14 +0000 (09:34 +1000)
fix warnings

mm/mempolicy.c:125:42: warning: missing braces around initializer [-Wmissing-braces]
  125 | static struct mempolicy default_policy = {
      |                                          ^
mm/mempolicy.c:125:42: warning: missing braces around initializer [-Wmissing-braces]
mm/mempolicy.c: In function 'numa_policy_init':
mm/mempolicy.c:2815:32: warning: missing braces around initializer [-Wmissing-braces]
 2815 |   preferred_node_policy[nid] = (struct mempolicy) {
      |                                ^
mm/mempolicy.c:2815:32: warning: missing braces around initializer [-Wmissing-braces]

Cc: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
mm/mempolicy.c

index 1dd82b8172349518b88ead19793d112240c6975c..6e92d6b011526036ba799c7b54c30452f9964a57 100644 (file)
@@ -120,7 +120,7 @@ enum zone_type policy_zone = 0;
  * run-time system-wide default policy => local allocation
  */
 static struct mempolicy default_policy = {
-       .refcnt = ATOMIC_INIT(1), /* never free it */
+       .refcnt = { ATOMIC_INIT(1), }, /* never free it */
        .mode = MPOL_LOCAL,
 };
 
@@ -2775,7 +2775,7 @@ void __init numa_policy_init(void)
 
        for_each_node(nid) {
                preferred_node_policy[nid] = (struct mempolicy) {
-                       .refcnt = ATOMIC_INIT(1),
+                       .refcnt = { ATOMIC_INIT(1), },
                        .mode = MPOL_PREFERRED,
                        .flags = MPOL_F_MOF | MPOL_F_MORON,
                        .nodes = nodemask_of_node(nid),