Thread (5 messages) flat view 5 messages, 3 authors, 2013-10-06

Re: [PATCH] net: secure_seq: Move net_secret_init() definition into CONFIG_IPV6 if block

From: Fabio Estevam <festevam@gmail.com>
Date: 2013-10-05 20:27:01

On Sat, Oct 5, 2013 at 5:09 PM, Fabio Estevam [off-list ref] wrote:
From: Fabio Estevam <redacted>

Commit 9a3bab6b05 (net: net_secret should not depend on TCP) introduced
the following build warning when CONFIG_IPV6 is not selected:

net/core/secure_seq.c:17:13: warning: 'net_secret_init' defined but not used [-Wunused-function]

Fix it by moving net_secret_init(void) inside the '#if IS_ENABLED(CONFIG_IPV6)'
block.

Reported-by: Olof Johansson <redacted>
Signed-off-by: Fabio Estevam <redacted>
Another solution would be:
--- a/net/core/secure_seq.c
+++ b/net/core/secure_seq.c
@@ -10,6 +10,7 @@

 #include <net/secure_seq.h>

+#if IS_ENABLED(CONFIG_IPV6)
 #define NET_SECRET_SIZE (MD5_MESSAGE_BYTES / 4)

 static u32 net_secret[NET_SECRET_SIZE] ____cacheline_aligned;
@@ -29,6 +30,7 @@ static void net_secret_init(void)
                cmpxchg(&net_secret[--i], 0, tmp);
        }
 }
+#endif
If this is preferred, I can send a v2 like that.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help