diff mbox series

[net-next] net: octeon_ep_vf: use ethtool_sprintf/puts

Message ID 20240809044738.4347-1-rosenp@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: octeon_ep_vf: use ethtool_sprintf/puts | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 7 this patch: 7
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 29 this patch: 29
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 29 this patch: 29
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 46 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-10--18-00 (tests: 707)

Commit Message

Rosen Penev Aug. 9, 2024, 4:47 a.m. UTC
Simplifies the function and avoids manual pointer manipulation.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 .../marvell/octeon_ep_vf/octep_vf_ethtool.c   | 36 ++++++++-----------
 1 file changed, 14 insertions(+), 22 deletions(-)

Comments

Simon Horman Aug. 12, 2024, 12:42 p.m. UTC | #1
On Thu, Aug 08, 2024 at 09:47:27PM -0700, Rosen Penev wrote:
> Simplifies the function and avoids manual pointer manipulation.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

Thanks,

The code changes look good to me and my local testing shows that it compiles.
So, from that point of view:

Reviewed-by: Simon Horman <horms@kernel.org>

But I do have a few points about process, which I hope you will
give due consideration:

1. It would be good if the patch description was a bit more verbose.
   And indicated how you found this problem (by inspection?)
   and how it was tested (compile tested only?).

   This helps set expectations for reviewers of this patch,
   both now and in the future.

2. You have posed a number of similar patches.
   To aid review it would be best to group these, say in batches of
   no more than 10.

   F.e. Point 1, above, doesn't just apply to this patch.

3. Please do review the Networking subsystem process document

   https://docs.kernel.org/process/maintainer-netdev.html

...
Rosen Penev Aug. 12, 2024, 5:04 p.m. UTC | #2
On Mon, Aug 12, 2024 at 5:43 AM Simon Horman <horms@kernel.org> wrote:
>
> On Thu, Aug 08, 2024 at 09:47:27PM -0700, Rosen Penev wrote:
> > Simplifies the function and avoids manual pointer manipulation.
> >
> > Signed-off-by: Rosen Penev <rosenp@gmail.com>
>
> Thanks,
>
> The code changes look good to me and my local testing shows that it compiles.
> So, from that point of view:
>
> Reviewed-by: Simon Horman <horms@kernel.org>
>
> But I do have a few points about process, which I hope you will
> give due consideration:
>
> 1. It would be good if the patch description was a bit more verbose.
>    And indicated how you found this problem (by inspection?)
>    and how it was tested (compile tested only?).
Right. This is just an API change. There should be no actual change in
functionality.
>
>    This helps set expectations for reviewers of this patch,
>    both now and in the future.
>
> 2. You have posed a number of similar patches.
>    To aid review it would be best to group these, say in batches of
>    no more than 10.
I plan to do a treewide commit with a coccinelle script but would like
to manually fix the problematic ones before doing so. Having said that
I still need to figure out how to do a cover letter...
>
>    F.e. Point 1, above, doesn't just apply to this patch.
>
> 3. Please do review the Networking subsystem process document
>
>    https://docs.kernel.org/process/maintainer-netdev.html
>
> ...
Andrew Lunn Aug. 12, 2024, 9:03 p.m. UTC | #3
> > 2. You have posed a number of similar patches.
> >    To aid review it would be best to group these, say in batches of
> >    no more than 10.
> I plan to do a treewide commit with a coccinelle script but would like
> to manually fix the problematic ones before doing so. Having said that
> I still need to figure out how to do a cover letter...

git format-patch --cover-letter HEAD~42

I also find `b4 prep` good for managing patchsets, and it will produce
a cover letter by default if there is more than one patch in the set:

https://b4.docs.kernel.org/en/latest/contributor/prep.html

	Andrew
Simon Horman Aug. 13, 2024, 7:54 a.m. UTC | #4
On Mon, Aug 12, 2024 at 10:04:51AM -0700, Rosen Penev wrote:
> On Mon, Aug 12, 2024 at 5:43 AM Simon Horman <horms@kernel.org> wrote:
> >
> > On Thu, Aug 08, 2024 at 09:47:27PM -0700, Rosen Penev wrote:
> > > Simplifies the function and avoids manual pointer manipulation.
> > >
> > > Signed-off-by: Rosen Penev <rosenp@gmail.com>
> >
> > Thanks,
> >
> > The code changes look good to me and my local testing shows that it compiles.
> > So, from that point of view:
> >
> > Reviewed-by: Simon Horman <horms@kernel.org>
> >
> > But I do have a few points about process, which I hope you will
> > give due consideration:
> >
> > 1. It would be good if the patch description was a bit more verbose.
> >    And indicated how you found this problem (by inspection?)
> >    and how it was tested (compile tested only?).
> Right. This is just an API change. There should be no actual change in
> functionality.

Right, but adding this kind of information to the commit message
is useful.

> >
> >    This helps set expectations for reviewers of this patch,
> >    both now and in the future.
> >
> > 2. You have posed a number of similar patches.
> >    To aid review it would be best to group these, say in batches of
> >    no more than 10.
> I plan to do a treewide commit with a coccinelle script but would like
> to manually fix the problematic ones before doing so. Having said that
> I still need to figure out how to do a cover letter...

I suggest using at b4.
Else git format-patch (to prepare) + git send-email (to send).

FWIIW, I was not suggesting a large tree-wide patchset.
But rather, groups of related patches, in batches of 10 or less.

> >
> >    F.e. Point 1, above, doesn't just apply to this patch.
> >
> > 3. Please do review the Networking subsystem process document
> >
> >    https://docs.kernel.org/process/maintainer-netdev.html
> >
> > ...
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_ethtool.c b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_ethtool.c
index a1979b45e355..c7622159d195 100644
--- a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_ethtool.c
+++ b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_ethtool.c
@@ -58,32 +58,24 @@  static void octep_vf_get_strings(struct net_device *netdev,
 {
 	struct octep_vf_device *oct = netdev_priv(netdev);
 	u16 num_queues = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf);
-	char *strings = (char *)data;
 	int i, j;
 
 	switch (stringset) {
 	case ETH_SS_STATS:
-		for (i = 0; i < OCTEP_VF_GLOBAL_STATS_CNT; i++) {
-			snprintf(strings, ETH_GSTRING_LEN,
-				 octep_vf_gstrings_global_stats[i]);
-			strings += ETH_GSTRING_LEN;
-		}
-
-		for (i = 0; i < num_queues; i++) {
-			for (j = 0; j < OCTEP_VF_TX_Q_STATS_CNT; j++) {
-				snprintf(strings, ETH_GSTRING_LEN,
-					 octep_vf_gstrings_tx_q_stats[j], i);
-				strings += ETH_GSTRING_LEN;
-			}
-		}
-
-		for (i = 0; i < num_queues; i++) {
-			for (j = 0; j < OCTEP_VF_RX_Q_STATS_CNT; j++) {
-				snprintf(strings, ETH_GSTRING_LEN,
-					 octep_vf_gstrings_rx_q_stats[j], i);
-				strings += ETH_GSTRING_LEN;
-			}
-		}
+		for (i = 0; i < OCTEP_VF_GLOBAL_STATS_CNT; i++)
+			ethtool_puts(&data, octep_vf_gstrings_global_stats[i]);
+
+		for (i = 0; i < num_queues; i++)
+			for (j = 0; j < OCTEP_VF_TX_Q_STATS_CNT; j++)
+				ethtool_sprintf(&data,
+						octep_vf_gstrings_tx_q_stats[j],
+						i);
+
+		for (i = 0; i < num_queues; i++)
+			for (j = 0; j < OCTEP_VF_RX_Q_STATS_CNT; j++)
+				ethtool_sprintf(&data,
+						octep_vf_gstrings_rx_q_stats[j],
+						i);
 		break;
 	default:
 		break;