Skip to content

Commit cb03db9

Browse files
Fabio Estevamdavem330
authored andcommitted
net: secure_seq: Fix warning when CONFIG_IPV6 and CONFIG_INET are not selected
net_secret() is only used when CONFIG_IPV6 or CONFIG_INET are selected. Building a defconfig with both of these symbols unselected (Using the ARM at91sam9rl_defconfig, for example) leads to the following build warning: $ make at91sam9rl_defconfig # # configuration written to .config # $ make net/core/secure_seq.o scripts/kconfig/conf --silentoldconfig Kconfig CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h make[1]: `include/generated/mach-types.h' is up to date. CALL scripts/checksyscalls.sh CC net/core/secure_seq.o net/core/secure_seq.c:17:13: warning: 'net_secret_init' defined but not used [-Wunused-function] Fix this warning by protecting the definition of net_secret() with these symbols. Reported-by: Olof Johansson <olof@lixom.net> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9684d7b commit cb03db9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎net/core/secure_seq.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include <net/secure_seq.h>
1212

13+
#if IS_ENABLED(CONFIG_IPV6) || IS_ENABLED(CONFIG_INET)
1314
#define NET_SECRET_SIZE (MD5_MESSAGE_BYTES / 4)
1415

1516
static u32 net_secret[NET_SECRET_SIZE] ____cacheline_aligned;
@@ -29,6 +30,7 @@ static void net_secret_init(void)
2930
cmpxchg(&net_secret[--i], 0, tmp);
3031
}
3132
}
33+
#endif
3234

3335
#ifdef CONFIG_INET
3436
static u32 seq_scale(u32 seq)

0 commit comments

Comments
 (0)