Commit 40e4783e authored by Igor Maravic's avatar Igor Maravic Committed by David S. Miller

ipv4: arp: Cleanup in arp.c

Use "IS_ENABLED(CONFIG_FOO)" macro instead of
"defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE)"
Signed-off-by: default avatarIgor Maravic <igorm@etf.rs>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0a5912db
...@@ -277,9 +277,9 @@ static int arp_constructor(struct neighbour *neigh) ...@@ -277,9 +277,9 @@ static int arp_constructor(struct neighbour *neigh)
default: default:
break; break;
case ARPHRD_ROSE: case ARPHRD_ROSE:
#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #if IS_ENABLED(CONFIG_AX25)
case ARPHRD_AX25: case ARPHRD_AX25:
#if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE) #if IS_ENABLED(CONFIG_NETROM)
case ARPHRD_NETROM: case ARPHRD_NETROM:
#endif #endif
neigh->ops = &arp_broken_ops; neigh->ops = &arp_broken_ops;
...@@ -629,13 +629,13 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, ...@@ -629,13 +629,13 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
arp->ar_pro = htons(ETH_P_IP); arp->ar_pro = htons(ETH_P_IP);
break; break;
#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #if IS_ENABLED(CONFIG_AX25)
case ARPHRD_AX25: case ARPHRD_AX25:
arp->ar_hrd = htons(ARPHRD_AX25); arp->ar_hrd = htons(ARPHRD_AX25);
arp->ar_pro = htons(AX25_P_IP); arp->ar_pro = htons(AX25_P_IP);
break; break;
#if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE) #if IS_ENABLED(CONFIG_NETROM)
case ARPHRD_NETROM: case ARPHRD_NETROM:
arp->ar_hrd = htons(ARPHRD_NETROM); arp->ar_hrd = htons(ARPHRD_NETROM);
arp->ar_pro = htons(AX25_P_IP); arp->ar_pro = htons(AX25_P_IP);
...@@ -643,13 +643,13 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, ...@@ -643,13 +643,13 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
#endif #endif
#endif #endif
#if defined(CONFIG_FDDI) || defined(CONFIG_FDDI_MODULE) #if IS_ENABLED(CONFIG_FDDI)
case ARPHRD_FDDI: case ARPHRD_FDDI:
arp->ar_hrd = htons(ARPHRD_ETHER); arp->ar_hrd = htons(ARPHRD_ETHER);
arp->ar_pro = htons(ETH_P_IP); arp->ar_pro = htons(ETH_P_IP);
break; break;
#endif #endif
#if defined(CONFIG_TR) || defined(CONFIG_TR_MODULE) #if IS_ENABLED(CONFIG_TR)
case ARPHRD_IEEE802_TR: case ARPHRD_IEEE802_TR:
arp->ar_hrd = htons(ARPHRD_IEEE802); arp->ar_hrd = htons(ARPHRD_IEEE802);
arp->ar_pro = htons(ETH_P_IP); arp->ar_pro = htons(ETH_P_IP);
...@@ -1036,7 +1036,7 @@ static int arp_req_set(struct net *net, struct arpreq *r, ...@@ -1036,7 +1036,7 @@ static int arp_req_set(struct net *net, struct arpreq *r,
return -EINVAL; return -EINVAL;
} }
switch (dev->type) { switch (dev->type) {
#if defined(CONFIG_FDDI) || defined(CONFIG_FDDI_MODULE) #if IS_ENABLED(CONFIG_FDDI)
case ARPHRD_FDDI: case ARPHRD_FDDI:
/* /*
* According to RFC 1390, FDDI devices should accept ARP * According to RFC 1390, FDDI devices should accept ARP
...@@ -1282,7 +1282,7 @@ void __init arp_init(void) ...@@ -1282,7 +1282,7 @@ void __init arp_init(void)
} }
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #if IS_ENABLED(CONFIG_AX25)
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
/* /*
...@@ -1330,7 +1330,7 @@ static void arp_format_neigh_entry(struct seq_file *seq, ...@@ -1330,7 +1330,7 @@ static void arp_format_neigh_entry(struct seq_file *seq,
read_lock(&n->lock); read_lock(&n->lock);
/* Convert hardware address to XX:XX:XX:XX ... form. */ /* Convert hardware address to XX:XX:XX:XX ... form. */
#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #if IS_ENABLED(CONFIG_AX25)
if (hatype == ARPHRD_AX25 || hatype == ARPHRD_NETROM) if (hatype == ARPHRD_AX25 || hatype == ARPHRD_NETROM)
ax2asc2((ax25_address *)n->ha, hbuffer); ax2asc2((ax25_address *)n->ha, hbuffer);
else { else {
...@@ -1343,7 +1343,7 @@ static void arp_format_neigh_entry(struct seq_file *seq, ...@@ -1343,7 +1343,7 @@ static void arp_format_neigh_entry(struct seq_file *seq,
if (k != 0) if (k != 0)
--k; --k;
hbuffer[k] = 0; hbuffer[k] = 0;
#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #if IS_ENABLED(CONFIG_AX25)
} }
#endif #endif
sprintf(tbuf, "%pI4", n->primary_key); sprintf(tbuf, "%pI4", n->primary_key);
......
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