ionic: fold adminq clean into service routine
authorShannon Nelson <shannon.nelson@amd.com>
Wed, 6 Mar 2024 23:29:52 +0000 (15:29 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Mar 2024 11:54:34 +0000 (11:54 +0000)
Since the AdminQ clean is a simple action called from only
one place, fold it back into the service routine.

Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pensando/ionic/ionic_main.c

index d248f725ef4479901e9c7f8b6a1de4e6ea3893db..c1259324b0be8115104cf964d2e43587e113136f 100644 (file)
@@ -247,24 +247,6 @@ static int ionic_adminq_check_err(struct ionic_lif *lif,
        return err;
 }
 
-static void ionic_adminq_clean(struct ionic_queue *q,
-                              struct ionic_admin_desc_info *desc_info,
-                              struct ionic_admin_comp *comp)
-{
-       struct ionic_admin_ctx *ctx = desc_info->ctx;
-
-       if (!ctx)
-               return;
-
-       memcpy(&ctx->comp, comp, sizeof(*comp));
-
-       dev_dbg(q->dev, "comp admin queue command:\n");
-       dynamic_hex_dump("comp ", DUMP_PREFIX_OFFSET, 16, 1,
-                        &ctx->comp, sizeof(ctx->comp), true);
-
-       complete_all(&ctx->work);
-}
-
 bool ionic_notifyq_service(struct ionic_cq *cq)
 {
        struct ionic_deferred_work *work;
@@ -338,9 +320,17 @@ bool ionic_adminq_service(struct ionic_cq *cq)
                desc_info = &q->admin_info[q->tail_idx];
                index = q->tail_idx;
                q->tail_idx = (q->tail_idx + 1) & (q->num_descs - 1);
-               if (likely(desc_info->ctx))
-                       ionic_adminq_clean(q, desc_info, comp);
-               desc_info->ctx = NULL;
+               if (likely(desc_info->ctx)) {
+                       struct ionic_admin_ctx *ctx = desc_info->ctx;
+
+                       memcpy(&ctx->comp, comp, sizeof(*comp));
+
+                       dev_dbg(q->dev, "comp admin queue command:\n");
+                       dynamic_hex_dump("comp ", DUMP_PREFIX_OFFSET, 16, 1,
+                                        &ctx->comp, sizeof(ctx->comp), true);
+                       complete_all(&ctx->work);
+                       desc_info->ctx = NULL;
+               }
        } while (index != le16_to_cpu(comp->comp_index));
 
        return true;