diff options
author | Javier Martinez Canillas <javier@osg.samsung.com> | 2016-09-09 08:43:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-11 00:19:10 -0400 |
commit | 9a81c34ace3598188f633d4654a2a57b7f7a2c2a (patch) | |
tree | 81d29da90955e69ab68ab02ef76d8083e436275c /net/atm/lec.c | |
parent | a73ec314a0d28cdbc29b4e4ad10871df0829986d (diff) |
lec: use IS_ENABLED() instead of checking for built-in or module
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.
Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm/lec.c')
-rw-r--r-- | net/atm/lec.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/atm/lec.c b/net/atm/lec.c index e574a7e9db6f..5d2693826afb 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <linux/atmlec.h> | 31 | #include <linux/atmlec.h> |
32 | 32 | ||
33 | /* Proxy LEC knows about bridging */ | 33 | /* Proxy LEC knows about bridging */ |
34 | #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) | 34 | #if IS_ENABLED(CONFIG_BRIDGE) |
35 | #include "../bridge/br_private.h" | 35 | #include "../bridge/br_private.h" |
36 | 36 | ||
37 | static unsigned char bridge_ula_lec[] = { 0x01, 0x80, 0xc2, 0x00, 0x00 }; | 37 | static unsigned char bridge_ula_lec[] = { 0x01, 0x80, 0xc2, 0x00, 0x00 }; |
@@ -121,7 +121,7 @@ static unsigned char bus_mac[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; | |||
121 | /* Device structures */ | 121 | /* Device structures */ |
122 | static struct net_device *dev_lec[MAX_LEC_ITF]; | 122 | static struct net_device *dev_lec[MAX_LEC_ITF]; |
123 | 123 | ||
124 | #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) | 124 | #if IS_ENABLED(CONFIG_BRIDGE) |
125 | static void lec_handle_bridge(struct sk_buff *skb, struct net_device *dev) | 125 | static void lec_handle_bridge(struct sk_buff *skb, struct net_device *dev) |
126 | { | 126 | { |
127 | char *buff; | 127 | char *buff; |
@@ -155,7 +155,7 @@ static void lec_handle_bridge(struct sk_buff *skb, struct net_device *dev) | |||
155 | sk->sk_data_ready(sk); | 155 | sk->sk_data_ready(sk); |
156 | } | 156 | } |
157 | } | 157 | } |
158 | #endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */ | 158 | #endif /* IS_ENABLED(CONFIG_BRIDGE) */ |
159 | 159 | ||
160 | /* | 160 | /* |
161 | * Open/initialize the netdevice. This is called (in the current kernel) | 161 | * Open/initialize the netdevice. This is called (in the current kernel) |
@@ -222,7 +222,7 @@ static netdev_tx_t lec_start_xmit(struct sk_buff *skb, | |||
222 | pr_debug("skbuff head:%lx data:%lx tail:%lx end:%lx\n", | 222 | pr_debug("skbuff head:%lx data:%lx tail:%lx end:%lx\n", |
223 | (long)skb->head, (long)skb->data, (long)skb_tail_pointer(skb), | 223 | (long)skb->head, (long)skb->data, (long)skb_tail_pointer(skb), |
224 | (long)skb_end_pointer(skb)); | 224 | (long)skb_end_pointer(skb)); |
225 | #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) | 225 | #if IS_ENABLED(CONFIG_BRIDGE) |
226 | if (memcmp(skb->data, bridge_ula_lec, sizeof(bridge_ula_lec)) == 0) | 226 | if (memcmp(skb->data, bridge_ula_lec, sizeof(bridge_ula_lec)) == 0) |
227 | lec_handle_bridge(skb, dev); | 227 | lec_handle_bridge(skb, dev); |
228 | #endif | 228 | #endif |
@@ -426,7 +426,7 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb) | |||
426 | (unsigned short)(0xffff & mesg->content.normal.flag); | 426 | (unsigned short)(0xffff & mesg->content.normal.flag); |
427 | break; | 427 | break; |
428 | case l_should_bridge: | 428 | case l_should_bridge: |
429 | #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) | 429 | #if IS_ENABLED(CONFIG_BRIDGE) |
430 | { | 430 | { |
431 | pr_debug("%s: bridge zeppelin asks about %pM\n", | 431 | pr_debug("%s: bridge zeppelin asks about %pM\n", |
432 | dev->name, mesg->content.proxy.mac_addr); | 432 | dev->name, mesg->content.proxy.mac_addr); |
@@ -452,7 +452,7 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb) | |||
452 | sk->sk_data_ready(sk); | 452 | sk->sk_data_ready(sk); |
453 | } | 453 | } |
454 | } | 454 | } |
455 | #endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */ | 455 | #endif /* IS_ENABLED(CONFIG_BRIDGE) */ |
456 | break; | 456 | break; |
457 | default: | 457 | default: |
458 | pr_info("%s: Unknown message type %d\n", dev->name, mesg->type); | 458 | pr_info("%s: Unknown message type %d\n", dev->name, mesg->type); |