Skip to content

Commit

Permalink
cxgb4i : Fix -Wunused-function warning
Browse files Browse the repository at this point in the history
A bunch of ipv6 related code is left on by default. While this causes no
compilation issues, there is no need to have this enabled by default. Guard
with an ipv6 check, which also takes care of a -Wunused-function warning.

Signed-off-by: Anish Bhatt <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
anish authored and davem330 committed Oct 15, 2014
1 parent 1bb6037 commit f42bb57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ static void send_act_open_req(struct cxgbi_sock *csk, struct sk_buff *skb,
cxgb4_l2t_send(csk->cdev->ports[csk->port_id], skb, csk->l2t);
}

#if IS_ENABLED(CONFIG_IPV6)
static void send_act_open_req6(struct cxgbi_sock *csk, struct sk_buff *skb,
struct l2t_entry *e)
{
Expand Down Expand Up @@ -344,6 +345,7 @@ static void send_act_open_req6(struct cxgbi_sock *csk, struct sk_buff *skb,

cxgb4_l2t_send(csk->cdev->ports[csk->port_id], skb, csk->l2t);
}
#endif

static void send_close_req(struct cxgbi_sock *csk)
{
Expand Down Expand Up @@ -781,9 +783,11 @@ static void csk_act_open_retry_timer(unsigned long data)
if (csk->csk_family == AF_INET) {
send_act_open_func = send_act_open_req;
skb = alloc_wr(size, 0, GFP_ATOMIC);
#if IS_ENABLED(CONFIG_IPV6)
} else {
send_act_open_func = send_act_open_req6;
skb = alloc_wr(size6, 0, GFP_ATOMIC);
#endif
}

if (!skb)
Expand Down Expand Up @@ -1335,8 +1339,10 @@ static int init_act_open(struct cxgbi_sock *csk)

if (csk->csk_family == AF_INET)
skb = alloc_wr(size, 0, GFP_NOIO);
#if IS_ENABLED(CONFIG_IPV6)
else
skb = alloc_wr(size6, 0, GFP_NOIO);
#endif

if (!skb)
goto rel_resource;
Expand Down Expand Up @@ -1370,8 +1376,10 @@ static int init_act_open(struct cxgbi_sock *csk)
cxgbi_sock_set_state(csk, CTP_ACTIVE_OPEN);
if (csk->csk_family == AF_INET)
send_act_open_req(csk, skb, csk->l2t);
#if IS_ENABLED(CONFIG_IPV6)
else
send_act_open_req6(csk, skb, csk->l2t);
#endif
neigh_release(n);

return 0;
Expand Down
2 changes: 2 additions & 0 deletions drivers/scsi/cxgbi/libcxgbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ struct cxgbi_device *cxgbi_device_find_by_netdev_rcu(struct net_device *ndev,
}
EXPORT_SYMBOL_GPL(cxgbi_device_find_by_netdev_rcu);

#if IS_ENABLED(CONFIG_IPV6)
static struct cxgbi_device *cxgbi_device_find_by_mac(struct net_device *ndev,
int *port)
{
Expand Down Expand Up @@ -307,6 +308,7 @@ static struct cxgbi_device *cxgbi_device_find_by_mac(struct net_device *ndev,
ndev, ndev->name);
return NULL;
}
#endif

void cxgbi_hbas_remove(struct cxgbi_device *cdev)
{
Expand Down

0 comments on commit f42bb57

Please sign in to comment.