Message ID | 20240807190303.6143-1-rosenp@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | df665ab188cdca8b8b3e0cca84a6511c395f9ece |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: atlantic: use ethtool_sprintf | expand |
On Wed, Aug 07, 2024 at 12:02:53PM -0700, Rosen Penev wrote: > Allows simplifying get_strings and avoids manual pointer manipulation. > > Signed-off-by: Rosen Penev <rosenp@gmail.com> > --- > .../ethernet/aquantia/atlantic/aq_ethtool.c | 21 +++++++------------ > 1 file changed, 7 insertions(+), 14 deletions(-) > [...] Patch seems fine overall, but two suggestions: - Use the subject line '[PATCH net-next]' so this goes to the right tree. - As Andrew mentioned for your other submission: use the get_maintainers script to ensure all the right people are CC'd. For more info check the docs: https://www.kernel.org/doc/html/v6.11-rc2/process/submitting-patches.html#select-the-recipients-for-your-patch I'll admit that it is not clear to me if this should be marked as "RESEND" or "v2", but I'd go with v2: example: git format-patch HEAD~1 --subject-prefix="PATCH net-next" \ -v 2 -o /output/path/ Assuming the code remains the same (and you are just modifying the subject line and to/cc list in the v2), you can add my Reviewed-by tag to the patch: Reviewed-by: Joe Damato <jdamato@fastly.com>
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Wed, 7 Aug 2024 12:02:53 -0700 you wrote: > Allows simplifying get_strings and avoids manual pointer manipulation. > > Signed-off-by: Rosen Penev <rosenp@gmail.com> > --- > .../ethernet/aquantia/atlantic/aq_ethtool.c | 21 +++++++------------ > 1 file changed, 7 insertions(+), 14 deletions(-) Here is the summary with links: - net: atlantic: use ethtool_sprintf https://git.kernel.org/netdev/net-next/c/df665ab188cd You are awesome, thank you!
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c index d0aecd1d7357..38f22918c699 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c @@ -279,18 +279,16 @@ static void aq_ethtool_get_strings(struct net_device *ndev, for (i = 0; i < cfg->vecs; i++) { for (si = 0; si < rx_stat_cnt; si++) { - snprintf(p, ETH_GSTRING_LEN, + ethtool_sprintf(&p, aq_ethtool_queue_rx_stat_names[si], tc_string, AQ_NIC_CFG_TCVEC2RING(cfg, tc, i)); - p += ETH_GSTRING_LEN; } for (si = 0; si < tx_stat_cnt; si++) { - snprintf(p, ETH_GSTRING_LEN, + ethtool_sprintf(&p, aq_ethtool_queue_tx_stat_names[si], tc_string, AQ_NIC_CFG_TCVEC2RING(cfg, tc, i)); - p += ETH_GSTRING_LEN; } } } @@ -305,20 +303,18 @@ static void aq_ethtool_get_strings(struct net_device *ndev, for (i = 0; i < max(rx_ring_cnt, tx_ring_cnt); i++) { for (si = 0; si < rx_stat_cnt; si++) { - snprintf(p, ETH_GSTRING_LEN, + ethtool_sprintf(&p, aq_ethtool_queue_rx_stat_names[si], tc_string, i ? PTP_HWST_RING_IDX : ptp_ring_idx); - p += ETH_GSTRING_LEN; } if (i >= tx_ring_cnt) continue; for (si = 0; si < tx_stat_cnt; si++) { - snprintf(p, ETH_GSTRING_LEN, + ethtool_sprintf(&p, aq_ethtool_queue_tx_stat_names[si], tc_string, i ? PTP_HWST_RING_IDX : ptp_ring_idx); - p += ETH_GSTRING_LEN; } } } @@ -338,9 +334,8 @@ static void aq_ethtool_get_strings(struct net_device *ndev, for (si = 0; si < ARRAY_SIZE(aq_macsec_txsc_stat_names); si++) { - snprintf(p, ETH_GSTRING_LEN, + ethtool_sprintf(&p, aq_macsec_txsc_stat_names[si], i); - p += ETH_GSTRING_LEN; } aq_txsc = &nic->macsec_cfg->aq_txsc[i]; for (sa = 0; sa < MACSEC_NUM_AN; sa++) { @@ -349,10 +344,9 @@ static void aq_ethtool_get_strings(struct net_device *ndev, for (si = 0; si < ARRAY_SIZE(aq_macsec_txsa_stat_names); si++) { - snprintf(p, ETH_GSTRING_LEN, + ethtool_sprintf(&p, aq_macsec_txsa_stat_names[si], i, sa); - p += ETH_GSTRING_LEN; } } } @@ -369,10 +363,9 @@ static void aq_ethtool_get_strings(struct net_device *ndev, for (si = 0; si < ARRAY_SIZE(aq_macsec_rxsa_stat_names); si++) { - snprintf(p, ETH_GSTRING_LEN, + ethtool_sprintf(&p, aq_macsec_rxsa_stat_names[si], i, sa); - p += ETH_GSTRING_LEN; } } }
Allows simplifying get_strings and avoids manual pointer manipulation. Signed-off-by: Rosen Penev <rosenp@gmail.com> --- .../ethernet/aquantia/atlantic/aq_ethtool.c | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-)