Commit 85a0cd81 authored by Intiyaz Basha's avatar Intiyaz Basha Committed by David S. Miller

liquidio: Moved common function list_delete_head to octeon_network.h

Moved common function list_delete_head to octeon_network.h
and renamed it to lio_list_delete_head
Signed-off-by: default avatarIntiyaz Basha <intiyaz.basha@cavium.com>
Acked-by: default avatarDerek Chickles <derek.chickles@cavium.com>
Signed-off-by: default avatarFelix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 592a4ceb
...@@ -541,25 +541,6 @@ static inline int check_txq_status(struct lio *lio) ...@@ -541,25 +541,6 @@ static inline int check_txq_status(struct lio *lio)
return ret_val; return ret_val;
} }
/**
* Remove the node at the head of the list. The list would be empty at
* the end of this call if there are no more nodes in the list.
*/
static inline struct list_head *list_delete_head(struct list_head *root)
{
struct list_head *node;
if ((root->prev == root) && (root->next == root))
node = NULL;
else
node = root->next;
if (node)
list_del(node);
return node;
}
/** /**
* \brief Delete gather lists * \brief Delete gather lists
* @param lio per-network private data * @param lio per-network private data
...@@ -578,7 +559,7 @@ static void delete_glists(struct lio *lio) ...@@ -578,7 +559,7 @@ static void delete_glists(struct lio *lio)
for (i = 0; i < lio->linfo.num_txpciq; i++) { for (i = 0; i < lio->linfo.num_txpciq; i++) {
do { do {
g = (struct octnic_gather *) g = (struct octnic_gather *)
list_delete_head(&lio->glist[i]); lio_list_delete_head(&lio->glist[i]);
if (g) if (g)
kfree(g); kfree(g);
} while (g); } while (g);
...@@ -2590,7 +2571,7 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -2590,7 +2571,7 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)
spin_lock(&lio->glist_lock[q_idx]); spin_lock(&lio->glist_lock[q_idx]);
g = (struct octnic_gather *) g = (struct octnic_gather *)
list_delete_head(&lio->glist[q_idx]); lio_list_delete_head(&lio->glist[q_idx]);
spin_unlock(&lio->glist_lock[q_idx]); spin_unlock(&lio->glist_lock[q_idx]);
if (!g) { if (!g) {
......
...@@ -284,25 +284,6 @@ static struct pci_driver liquidio_vf_pci_driver = { ...@@ -284,25 +284,6 @@ static struct pci_driver liquidio_vf_pci_driver = {
.err_handler = &liquidio_vf_err_handler, /* For AER */ .err_handler = &liquidio_vf_err_handler, /* For AER */
}; };
/**
* Remove the node at the head of the list. The list would be empty at
* the end of this call if there are no more nodes in the list.
*/
static struct list_head *list_delete_head(struct list_head *root)
{
struct list_head *node;
if ((root->prev == root) && (root->next == root))
node = NULL;
else
node = root->next;
if (node)
list_del(node);
return node;
}
/** /**
* \brief Delete gather lists * \brief Delete gather lists
* @param lio per-network private data * @param lio per-network private data
...@@ -321,7 +302,7 @@ static void delete_glists(struct lio *lio) ...@@ -321,7 +302,7 @@ static void delete_glists(struct lio *lio)
for (i = 0; i < lio->linfo.num_txpciq; i++) { for (i = 0; i < lio->linfo.num_txpciq; i++) {
do { do {
g = (struct octnic_gather *) g = (struct octnic_gather *)
list_delete_head(&lio->glist[i]); lio_list_delete_head(&lio->glist[i]);
kfree(g); kfree(g);
} while (g); } while (g);
...@@ -1644,8 +1625,8 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -1644,8 +1625,8 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)
int i, frags; int i, frags;
spin_lock(&lio->glist_lock[q_idx]); spin_lock(&lio->glist_lock[q_idx]);
g = (struct octnic_gather *)list_delete_head( g = (struct octnic_gather *)
&lio->glist[q_idx]); lio_list_delete_head(&lio->glist[q_idx]);
spin_unlock(&lio->glist_lock[q_idx]); spin_unlock(&lio->glist_lock[q_idx]);
if (!g) { if (!g) {
......
...@@ -565,4 +565,23 @@ static inline int skb_iq(struct lio *lio, struct sk_buff *skb) ...@@ -565,4 +565,23 @@ static inline int skb_iq(struct lio *lio, struct sk_buff *skb)
return skb->queue_mapping % lio->linfo.num_txpciq; return skb->queue_mapping % lio->linfo.num_txpciq;
} }
/**
* Remove the node at the head of the list. The list would be empty at
* the end of this call if there are no more nodes in the list.
*/
static inline struct list_head *lio_list_delete_head(struct list_head *root)
{
struct list_head *node;
if (root->prev == root && root->next == root)
node = NULL;
else
node = root->next;
if (node)
list_del(node);
return node;
}
#endif #endif
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