]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
octeontx2-af: simplify rvu_debugfs
authorYury Norov <ynorov@nvidia.com>
Thu, 19 Mar 2026 20:17:10 +0000 (16:17 -0400)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 24 Mar 2026 10:08:17 +0000 (11:08 +0100)
The driver uses bitmap_print_to_pagebuf() to store human-readable
bitmaps representations in a temporary buffers; and then feed
seq_printf() with it.

Switch to using seq_printf("%*pb") directly and drop intermediate
buffer.

Signed-off-by: Yury Norov <ynorov@nvidia.com>
Link: https://patch.msgid.link/20260319201713.941956-2-ynorov@nvidia.com
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c

index 413f9fa40b330426ff54b3bc779498ab38d14fbe..fa461489acdd653246f4fbffbd46c541ba2c3a7a 100644 (file)
@@ -962,30 +962,21 @@ static bool rvu_dbg_is_valid_lf(struct rvu *rvu, int blkaddr, int lf,
 
 static void print_npa_qsize(struct seq_file *m, struct rvu_pfvf *pfvf)
 {
-       char *buf;
-
-       buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
-       if (!buf)
-               return;
-
        if (!pfvf->aura_ctx) {
                seq_puts(m, "Aura context is not initialized\n");
        } else {
-               bitmap_print_to_pagebuf(false, buf, pfvf->aura_bmap,
-                                       pfvf->aura_ctx->qsize);
                seq_printf(m, "Aura count : %d\n", pfvf->aura_ctx->qsize);
-               seq_printf(m, "Aura context ena/dis bitmap : %s\n", buf);
+               seq_printf(m, "Aura context ena/dis bitmap : %*pb\n",
+                          pfvf->aura_ctx->qsize, pfvf->aura_bmap);
        }
 
        if (!pfvf->pool_ctx) {
                seq_puts(m, "Pool context is not initialized\n");
        } else {
-               bitmap_print_to_pagebuf(false, buf, pfvf->pool_bmap,
-                                       pfvf->pool_ctx->qsize);
                seq_printf(m, "Pool count : %d\n", pfvf->pool_ctx->qsize);
-               seq_printf(m, "Pool context ena/dis bitmap : %s\n", buf);
+               seq_printf(m, "Pool context ena/dis bitmap : %*pb\n",
+                          pfvf->pool_ctx->qsize, pfvf->pool_bmap);
        }
-       kfree(buf);
 }
 
 /* The 'qsize' entry dumps current Aura/Pool context Qsize
@@ -2547,17 +2538,8 @@ RVU_DEBUG_SEQ_FOPS(nix_cq_ctx, nix_cq_ctx_display, nix_cq_ctx_write);
 static void print_nix_qctx_qsize(struct seq_file *filp, int qsize,
                                 unsigned long *bmap, char *qtype)
 {
-       char *buf;
-
-       buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
-       if (!buf)
-               return;
-
-       bitmap_print_to_pagebuf(false, buf, bmap, qsize);
        seq_printf(filp, "%s context count : %d\n", qtype, qsize);
-       seq_printf(filp, "%s context ena/dis bitmap : %s\n",
-                  qtype, buf);
-       kfree(buf);
+       seq_printf(filp, "%s context ena/dis bitmap : %*pb\n", qtype, qsize, bmap);
 }
 
 static void print_nix_qsize(struct seq_file *filp, struct rvu_pfvf *pfvf)