lkml.org 
[lkml]   [2018]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 11/17] prmem: llist: use designated initializer
Date
Using a list_head in an unnamed union poses a problem with the current
implementation of the initializer, since it doesn't specify the names of
the fields it is initializing.

This patch makes it use designated initializers.

Signed-off-by: Igor Stoppa <igor.stoppa@huawei.com>
CC: Kate Stewart <kstewart@linuxfoundation.org>
CC: "David S. Miller" <davem@davemloft.net>
CC: Edward Cree <ecree@solarflare.com>
CC: Philippe Ombredanne <pombredanne@nexb.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: linux-kernel@vger.kernel.org
---
include/linux/list.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/list.h b/include/linux/list.h
index de04cc5ed536..184a7b60436f 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -18,7 +18,10 @@
* using the generic single-entry routines.
*/

-#define LIST_HEAD_INIT(name) { &(name), &(name) }
+#define LIST_HEAD_INIT(name) { \
+ .next = &(name), \
+ .prev = &(name), \
+}

#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)
--
2.17.1
\
 
 \ /
  Last update: 2018-10-23 23:38    [W:0.034 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site