* [PATCH] octeontx2-af: Change block parameter to const pointer in get_lf_str_list
@ 2024-09-19 9:19 Riyan Dhiman
2024-09-19 15:10 ` Simon Horman
0 siblings, 1 reply; 2+ messages in thread
From: Riyan Dhiman @ 2024-09-19 9:19 UTC (permalink / raw)
To: sgoutham, lcherian, gakula, jerinj, hkelam, davem, edumazet, kuba,
pabeni
Cc: rsaladi2, netdev, linux-kernel, Riyan Dhiman
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.
Fixes: e77bcdd1f639 (octeontx2-af: Display all enabled PF VF rsrc_alloc entries.)
Signed-off-by: Riyan Dhiman <riyandhiman14@gmail.com>
---
Compile tested only
.../ethernet/marvell/octeontx2/af/rvu_debugfs.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
index 87ba77e5026a..8c700ee4a82b 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
@@ -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) {
@@ -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;
}
@@ -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;
--
2.46.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] octeontx2-af: Change block parameter to const pointer in get_lf_str_list
2024-09-19 9:19 [PATCH] octeontx2-af: Change block parameter to const pointer in get_lf_str_list Riyan Dhiman
@ 2024-09-19 15:10 ` Simon Horman
0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2024-09-19 15:10 UTC (permalink / raw)
To: Riyan Dhiman
Cc: sgoutham, lcherian, gakula, jerinj, hkelam, davem, edumazet, kuba,
pabeni, rsaladi2, netdev, linux-kernel
On Thu, Sep 19, 2024 at 02:49:36PM +0530, Riyan Dhiman wrote:
> 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.
>
> Fixes: e77bcdd1f639 (octeontx2-af: Display all enabled PF VF rsrc_alloc entries.)
> Signed-off-by: Riyan Dhiman <riyandhiman14@gmail.com>
Hi Riyan,
Thanks for your patch.
While I agree that this is a nice change I don't feel that it is
a fix, typically something that addresses a user-visible bug.
I suggest that the patch should be treated as an enhancement.
It should not have a Fixes tag. And it should be targeted at
net-next (as opposed to net, which is, in general, for fixes).
Subject: [PATCH net-next] ...
Please note that net-next is currently closed for the v6.12 merge window.
It should reopen after v6.12-rc1 has been released, likely during
the week of the 30th September.
So please consider reposting your patch once net-next has reopened.
Link: https://docs.kernel.org/process/maintainer-netdev.html
--
pw-bot: defer
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-19 15:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-19 9:19 [PATCH] octeontx2-af: Change block parameter to const pointer in get_lf_str_list Riyan Dhiman
2024-09-19 15:10 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).