[bug report] octeontx2-af: cn10k: Identical code for different branches

2 messages, 2 authors, 2021-02-14 · open the first message on its own page

[bug report] octeontx2-af: cn10k: Identical code for different branches

From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Date: 2021-02-12 20:02:59

Hi,

In file drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c, function rvu_dbg_init()
the same code is executed for both branches:

2431         if (is_rvu_otx2(rvu))
2432                 debugfs_create_file("rvu_pf_cgx_map", 0444, rvu->rvu_dbg.root,
2433                                     rvu, &rvu_dbg_rvu_pf_cgx_map_fops);
2434         else
2435                 debugfs_create_file("rvu_pf_cgx_map", 0444, rvu->rvu_dbg.root,
2436                                     rvu, &rvu_dbg_rvu_pf_cgx_map_fops);

This issue was introduced by commit 91c6945ea1f9 ("octeontx2-af: cn10k: Add RPM MAC support")

What's the right solution for this?

Thanks
---
Gustavo

Re: [EXT] [bug report] octeontx2-af: cn10k: Identical code for different branches

From: Geethasowjanya Akula <gakula@marvell.com>
Date: 2021-02-14 02:47:18

Hi Gustavo,

Please see inline.


________________________________________
From: Gustavo A. R. Silva <gustavoars@kernel.org>
Sent: Saturday, February 13, 2021 1:31 AM
To: Sunil Kovvuri Goutham; Linu Cherian; Geethasowjanya Akula; Jerin Jacob >Kollanukkaran; Hariprasad Kelam; Subbaraya Sundeep Bhatta; David S. Miller; Jakub >Kicinski
Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Gustavo A. R. Silva
Subject: [EXT] [bug report] octeontx2-af: cn10k: Identical code for different branches
External Email
----------------------------------------------------------------------
Hi,
In file drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c, function rvu_dbg_init()
the same code is executed for both branches:
2431         if (is_rvu_otx2(rvu))
2432                 debugfs_create_file("rvu_pf_cgx_map", 0444, rvu->rvu_dbg.root,
2433                                     rvu, &rvu_dbg_rvu_pf_cgx_map_fops);
2434         else
2435                 debugfs_create_file("rvu_pf_cgx_map", 0444, rvu->rvu_dbg.root,
2436                                     rvu, &rvu_dbg_rvu_pf_cgx_map_fops);
This issue was introduced by commit 91c6945ea1f9 ("octeontx2-af: cn10k: Add RPM >MAC support")
What's the right solution for this?
Thanks Gustavo for pointing out.  below is the right cod for else conduction.

else
      debugfs_create_file("rvu_pf_rpm_map", 0444, rvu->rvu_dbg.root,
                                    rvu, &rvu_dbg_rvu_pf_cgx_map_fops);

Thanks
---
Gustavo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help