Subject: Re: [PATCH net-next v2] bnxt_en: add timestamping statistics support

From: Simon Horman <[email-masked]>
Date: Sat, 1 Jun 2024 17:04:10 +0100

On Thu, May 30, 2024 at 01:47:51PM -0700, Vadim Fedorenko wrote:
> The ethtool_ts_stats structure was introduced earlier this year. Now
> it's time to support this group of counters in more drivers.
> This patch adds support to bnxt driver.
> 
> Signed-off-by: Vadim Fedorenko <[email-masked]>

...

> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> index 8763f8a01457..bf157f6cc042 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> @@ -5233,6 +5233,19 @@ static void bnxt_get_rmon_stats(struct net_device *dev,
>  	*ranges = bnxt_rmon_ranges;
>  }
>  
> +static void bnxt_get_ptp_stats(struct net_device *dev,
> +			       struct ethtool_ts_stats *ts_stats)
> +{
> +	struct bnxt *bp = netdev_priv(dev);
> +	struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;

Hi Vadim,

If you need to update this patch for some other reason,
please consider arranging these local variables in
reverse xmas tree order - longest line to shortest.

In this case I think that would mean separating
the declaration and assignment of ptp, like this
(completely untested!):

	struct bnxt *bp = netdev_priv(dev);
	struct bnxt_ptp_cfg *ptp;

	ptp = bp->ptp_cfg;

Edward Cree's tool can be helpful here:
https://github.com/ecree-solarflare/xmastree

...