Commit 12827233 authored by Randy Dunlap's avatar Randy Dunlap Committed by David S. Miller

s390/net: lcs: use IS_ENABLED() for kconfig detection

When CONFIG_ETHERNET=m or CONFIG_FDDI=m, lcs.s has build errors or
warnings:

../drivers/s390/net/lcs.c:40:2: error: #error Cannot compile lcs.c without some net devices switched on.
   40 | #error Cannot compile lcs.c without some net devices switched on.
../drivers/s390/net/lcs.c: In function 'lcs_startlan_auto':
../drivers/s390/net/lcs.c:1601:13: warning: unused variable 'rc' [-Wunused-variable]
 1601 |         int rc;

Solve this by using IS_ENABLED(CONFIG_symbol) instead of ifdef
CONFIG_symbol. The latter only works for builtin (=y) values
while IS_ENABLED() works for builtin or modular values.
Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Cc: Alexandra Winter <wintera@linux.ibm.com>
Cc: Wenjia Zhang <wenjia@linux.ibm.com>
Cc: linux-s390@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 18da174d
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "lcs.h" #include "lcs.h"
#if !defined(CONFIG_ETHERNET) && !defined(CONFIG_FDDI) #if !IS_ENABLED(CONFIG_ETHERNET) && !IS_ENABLED(CONFIG_FDDI)
#error Cannot compile lcs.c without some net devices switched on. #error Cannot compile lcs.c without some net devices switched on.
#endif #endif
...@@ -1601,14 +1601,14 @@ lcs_startlan_auto(struct lcs_card *card) ...@@ -1601,14 +1601,14 @@ lcs_startlan_auto(struct lcs_card *card)
int rc; int rc;
LCS_DBF_TEXT(2, trace, "strtauto"); LCS_DBF_TEXT(2, trace, "strtauto");
#ifdef CONFIG_ETHERNET #if IS_ENABLED(CONFIG_ETHERNET)
card->lan_type = LCS_FRAME_TYPE_ENET; card->lan_type = LCS_FRAME_TYPE_ENET;
rc = lcs_send_startlan(card, LCS_INITIATOR_TCPIP); rc = lcs_send_startlan(card, LCS_INITIATOR_TCPIP);
if (rc == 0) if (rc == 0)
return 0; return 0;
#endif #endif
#ifdef CONFIG_FDDI #if IS_ENABLED(CONFIG_FDDI)
card->lan_type = LCS_FRAME_TYPE_FDDI; card->lan_type = LCS_FRAME_TYPE_FDDI;
rc = lcs_send_startlan(card, LCS_INITIATOR_TCPIP); rc = lcs_send_startlan(card, LCS_INITIATOR_TCPIP);
if (rc == 0) if (rc == 0)
...@@ -2139,13 +2139,13 @@ lcs_new_device(struct ccwgroup_device *ccwgdev) ...@@ -2139,13 +2139,13 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
goto netdev_out; goto netdev_out;
} }
switch (card->lan_type) { switch (card->lan_type) {
#ifdef CONFIG_ETHERNET #if IS_ENABLED(CONFIG_ETHERNET)
case LCS_FRAME_TYPE_ENET: case LCS_FRAME_TYPE_ENET:
card->lan_type_trans = eth_type_trans; card->lan_type_trans = eth_type_trans;
dev = alloc_etherdev(0); dev = alloc_etherdev(0);
break; break;
#endif #endif
#ifdef CONFIG_FDDI #if IS_ENABLED(CONFIG_FDDI)
case LCS_FRAME_TYPE_FDDI: case LCS_FRAME_TYPE_FDDI:
card->lan_type_trans = fddi_type_trans; card->lan_type_trans = fddi_type_trans;
dev = alloc_fddidev(0); dev = alloc_fddidev(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment