mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
ionic: clean up desc_info and cq_info structs
Remove some unnecessary struct fields and related code. Co-developed-by: Neel Patel <neel@pensando.io> Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
0c1d175b72
commit
339dcf7fe3
@@ -467,9 +467,7 @@ int ionic_cq_init(struct ionic_lif *lif, struct ionic_cq *cq,
|
||||
struct ionic_intr_info *intr,
|
||||
unsigned int num_descs, size_t desc_size)
|
||||
{
|
||||
struct ionic_cq_info *cur;
|
||||
unsigned int ring_size;
|
||||
unsigned int i;
|
||||
|
||||
if (desc_size == 0 || !is_power_of_2(num_descs))
|
||||
return -EINVAL;
|
||||
@@ -485,19 +483,6 @@ int ionic_cq_init(struct ionic_lif *lif, struct ionic_cq *cq,
|
||||
cq->tail_idx = 0;
|
||||
cq->done_color = 1;
|
||||
|
||||
cur = cq->info;
|
||||
|
||||
for (i = 0; i < num_descs; i++) {
|
||||
if (i + 1 == num_descs) {
|
||||
cur->next = cq->info;
|
||||
cur->last = true;
|
||||
} else {
|
||||
cur->next = cur + 1;
|
||||
}
|
||||
cur->index = i;
|
||||
cur++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -551,9 +536,7 @@ int ionic_q_init(struct ionic_lif *lif, struct ionic_dev *idev,
|
||||
unsigned int num_descs, size_t desc_size,
|
||||
size_t sg_desc_size, unsigned int pid)
|
||||
{
|
||||
struct ionic_desc_info *cur;
|
||||
unsigned int ring_size;
|
||||
unsigned int i;
|
||||
|
||||
if (desc_size == 0 || !is_power_of_2(num_descs))
|
||||
return -EINVAL;
|
||||
@@ -574,18 +557,6 @@ int ionic_q_init(struct ionic_lif *lif, struct ionic_dev *idev,
|
||||
|
||||
snprintf(q->name, sizeof(q->name), "L%d-%s%u", lif->index, name, index);
|
||||
|
||||
cur = q->info;
|
||||
|
||||
for (i = 0; i < num_descs; i++) {
|
||||
if (i + 1 == num_descs)
|
||||
cur->next = q->info;
|
||||
else
|
||||
cur->next = cur + 1;
|
||||
cur->index = i;
|
||||
cur->left = num_descs - i;
|
||||
cur++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -652,6 +623,7 @@ void ionic_q_service(struct ionic_queue *q, struct ionic_cq_info *cq_info,
|
||||
struct ionic_desc_info *desc_info;
|
||||
ionic_desc_cb cb;
|
||||
void *cb_arg;
|
||||
u16 index;
|
||||
|
||||
/* check for empty queue */
|
||||
if (q->tail_idx == q->head_idx)
|
||||
@@ -665,6 +637,7 @@ void ionic_q_service(struct ionic_queue *q, struct ionic_cq_info *cq_info,
|
||||
|
||||
do {
|
||||
desc_info = &q->info[q->tail_idx];
|
||||
index = q->tail_idx;
|
||||
q->tail_idx = (q->tail_idx + 1) & (q->num_descs - 1);
|
||||
|
||||
cb = desc_info->cb;
|
||||
@@ -675,5 +648,5 @@ void ionic_q_service(struct ionic_queue *q, struct ionic_cq_info *cq_info,
|
||||
|
||||
if (cb)
|
||||
cb(q, desc_info, cq_info, cb_arg);
|
||||
} while (desc_info->index != stop_index);
|
||||
} while (index != stop_index);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user