summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorCalvin Johnson <calvin.johnson@nxp.com>2017-10-18 13:04:41 (GMT)
committerXie Xiaobo <xiaobo.xie@nxp.com>2017-12-12 07:32:31 (GMT)
commit142ef8cca54def99154d89e0e7885349a60363f8 (patch)
treec75e102d99bdefe54debad52aeace448c90ddde2 /drivers/staging
parentcd9d3cc98ba819ee932f11ff35ab63a76ec347da (diff)
downloadlinux-142ef8cca54def99154d89e0e7885349a60363f8.tar.xz
staging: fsl_ppfe/eth: fix read/write/ack idx issue
While fixing checkpatch errors some of the index increments were commented out. They are enabled. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/fsl_ppfe/pfe_hif.c8
-rw-r--r--drivers/staging/fsl_ppfe/pfe_hif_lib.c9
2 files changed, 7 insertions, 10 deletions
diff --git a/drivers/staging/fsl_ppfe/pfe_hif.c b/drivers/staging/fsl_ppfe/pfe_hif.c
index 61b4d57..6835e14 100644
--- a/drivers/staging/fsl_ppfe/pfe_hif.c
+++ b/drivers/staging/fsl_ppfe/pfe_hif.c
@@ -511,9 +511,9 @@ static void *client_put_rxpacket(struct hif_rx_queue *queue, void *pkt, u32 len,
*/
smp_wmb();
writel(CL_DESC_BUF_LEN(len) | flags, &desc->ctrl);
- /* queue->write_idx = (queue->write_idx + 1)
- * & (queue->size - 1);
- */
+ queue->write_idx = (queue->write_idx + 1)
+ & (queue->size - 1);
+
free_pkt += pfe_pkt_headroom;
}
}
@@ -703,7 +703,7 @@ static int client_ack_txpacket(struct pfe_hif *hif, unsigned int client_id,
if (readl(&desc->ctrl) & CL_DESC_OWN) {
writel((readl(&desc->ctrl) & ~CL_DESC_OWN), &desc->ctrl);
- /* queue->ack_idx = (queue->ack_idx + 1) & (queue->size - 1); */
+ queue->ack_idx = (queue->ack_idx + 1) & (queue->size - 1);
return 0;
diff --git a/drivers/staging/fsl_ppfe/pfe_hif_lib.c b/drivers/staging/fsl_ppfe/pfe_hif_lib.c
index d5a5701..837eaa2 100644
--- a/drivers/staging/fsl_ppfe/pfe_hif_lib.c
+++ b/drivers/staging/fsl_ppfe/pfe_hif_lib.c
@@ -211,9 +211,6 @@ err:
return 1;
}
-#define inc_cl_idx(idxname) \
- ({ typeof(idxname) idxname_ = (idxname); \
- ((idxname_) = (idxname_ + 1) & (queue->size - 1)); })
static void hif_lib_client_cleanup_tx_queue(struct hif_client_tx_queue *queue)
{
@@ -465,7 +462,7 @@ void *hif_lib_receive_pkt(struct hif_client_s *client, int qno, int *len, int
smp_wmb();
desc->ctrl = CL_DESC_BUF_LEN(pfe_pkt_size) | CL_DESC_OWN;
- inc_cl_idx(queue->read_idx);
+ queue->read_idx = (queue->read_idx + 1) & (queue->size - 1);
}
/*spin_unlock_irqrestore(&client->rx_lock, flags); */
@@ -507,7 +504,7 @@ void __hif_lib_xmit_pkt(struct hif_client_s *client, unsigned int qno, void
__hif_xmit_pkt(&pfe->hif, client->id, qno, data, len, flags);
- inc_cl_idx(queue->write_idx);
+ queue->write_idx = (queue->write_idx + 1) & (queue->size - 1);
queue->tx_pending++;
queue->jiffies_last_packet = jiffies;
}
@@ -544,7 +541,7 @@ void *hif_lib_tx_get_next_complete(struct hif_client_s *client, int qno,
if (desc->ctrl & CL_DESC_OWN)
return NULL;
- inc_cl_idx(queue->read_idx);
+ queue->read_idx = (queue->read_idx + 1) & (queue->size - 1);
queue->tx_pending--;
*flags = CL_DESC_GET_FLAGS(desc->ctrl);