OSDN Git Service

net: use .data.once section in netdev_level_once()
authorEric Dumazet <edumazet@google.com>
Mon, 15 Nov 2021 17:23:02 +0000 (09:23 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 17 Nov 2021 03:07:53 +0000 (19:07 -0800)
Same rationale than prior patch : using the dedicated
section avoid holes and pack all these bool values.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/netdevice.h

index 31a7e6b..dd32836 100644 (file)
@@ -4942,7 +4942,7 @@ void netdev_info(const struct net_device *dev, const char *format, ...);
 
 #define netdev_level_once(level, dev, fmt, ...)                        \
 do {                                                           \
-       static bool __print_once __read_mostly;                 \
+       static bool __section(".data.once") __print_once;       \
                                                                \
        if (!__print_once) {                                    \
                __print_once = true;                            \