]> git.baikalelectronics.ru Git - kernel.git/commit
l2tp: fix unused function warning
authorArnd Bergmann <arnd@arndb.de>
Mon, 13 Aug 2018 21:43:05 +0000 (23:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Aug 2018 03:45:49 +0000 (20:45 -0700)
commit261ec0e6e5aa9cc7cecb2695e8d853785ea0bea9
treebf2724e414a7035fb883e9e8f4b165fc2dbe9894
parentfa7ae650a5a5b4c0d46ad10077c25464093db9f8
l2tp: fix unused function warning

Removing one of the callers of pppol2tp_session_get_sock caused a harmless
warning in some configurations:

net/l2tp/l2tp_ppp.c:142:21: 'pppol2tp_session_get_sock' defined but not used [-Wunused-function]

Rather than adding another #ifdef here, using a proper IS_ENABLED()
check makes the code more readable and avoids those warnings while
letting the compiler figure out for itself which code is needed.

This adds one pointer for the unused show() callback in struct
l2tp_session, but that seems harmless.

Fixes: 6c62dd5d9e36 ("l2tp: remove pppol2tp_session_ioctl()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_core.h
net/l2tp/l2tp_eth.c
net/l2tp/l2tp_ppp.c