Skip to content

Commit

Permalink
octeontx2-af: Change block parameter to const pointer in get_lf_str_list
Browse files Browse the repository at this point in the history
Convert struct rvu_block block to const struct rvu_block *block in
get_lf_str_list() function parameter. This improves efficiency by
avoiding structure copying and reflects the function's read-only
access to block.

Signed-off-by: Riyan Dhiman <riyandhiman14@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20241001110542.5404-2-riyandhiman14@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Ryand1234 authored and kuba-moo committed Oct 4, 2024
1 parent 8389cdb commit c55ff46
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,16 +663,16 @@ static ssize_t rvu_dbg_lmtst_map_table_display(struct file *filp,

RVU_DEBUG_FOPS(lmtst_map_table, lmtst_map_table_display, NULL);

static void get_lf_str_list(struct rvu_block block, int pcifunc,
static void get_lf_str_list(const struct rvu_block *block, int pcifunc,
char *lfs)
{
int lf = 0, seq = 0, len = 0, prev_lf = block.lf.max;
int lf = 0, seq = 0, len = 0, prev_lf = block->lf.max;

for_each_set_bit(lf, block.lf.bmap, block.lf.max) {
if (lf >= block.lf.max)
for_each_set_bit(lf, block->lf.bmap, block->lf.max) {
if (lf >= block->lf.max)
break;

if (block.fn_map[lf] != pcifunc)
if (block->fn_map[lf] != pcifunc)
continue;

if (lf == prev_lf + 1) {
Expand Down Expand Up @@ -719,7 +719,7 @@ static int get_max_column_width(struct rvu *rvu)
if (!strlen(block.name))
continue;

get_lf_str_list(block, pcifunc, buf);
get_lf_str_list(&block, pcifunc, buf);
if (lf_str_size <= strlen(buf))
lf_str_size = strlen(buf) + 1;
}
Expand Down Expand Up @@ -803,7 +803,7 @@ static ssize_t rvu_dbg_rsrc_attach_status(struct file *filp,
continue;
len = 0;
lfs[len] = '\0';
get_lf_str_list(block, pcifunc, lfs);
get_lf_str_list(&block, pcifunc, lfs);
if (strlen(lfs))
flag = 1;

Expand Down

0 comments on commit c55ff46

Please sign in to comment.