Subject: Re: [PATCH net-next 2/3] ice: Implement driver functionality to dump fec statistics

From: Jakub Kicinski <[email-masked]>
Date: Wed, 3 Jul 2024 19:55:57 -0700

On Tue,  2 Jul 2024 11:07:06 -0700 Tony Nguyen wrote:
> +	pf = np->vsi->back;
> +	hw = &pf->hw;
> +	pi = np->vsi->port_info;
> +
> +	if (!hw || !pi)
> +		return;

nit: hw can't possibly be NULL, it's pf + offset, even if pf is null hw
won't be; maybe also combine the pi check with the type check below?
to make it look less like defensive programming..

next patch has the same isse

> +	/* Serdes parameters are not supported if not the PF VSI */
> +	if (np->vsi->type != ICE_VSI_PF)
> +		return;
> +
> +	err = ice_get_port_topology(hw, pi->lport, &port_topology);
> +	if (err) {
> +		netdev_info(netdev, "Extended register dump failed Lport %d\n",
> +			    pi->lport);
> +		return;
> +	}
> +
> +	/* Get FEC correctable, uncorrectable counter */
> +	err = ice_get_port_fec_stats(hw, port_topology.pcs_quad_select,
> +				     port_topology.pcs_port, fec_stats);
> +	if (err) {
> +		netdev_info(netdev, "FEC stats get failed Lport %d Err %d\n",
> +			    pi->lport, err);
> +	}

unnecessary brackets
-- 
pw-bot: cr