Subject: Re: [PATCH v10 2/2] net/bnx2x: refactor common code to bnx2x_stop_nic()

From: Jacob Keller <[email-masked]>
Date: Wed, 14 Feb 2024 12:50:47 -0800

On 2/13/2024 10:32 AM, Thinh Tran wrote:
> Refactor common code which disables and releases HW interrupts, deletes
> NAPI objects, into a new bnx2x_stop_nic() function.
> 
> Signed-off-by: Thinh Tran <[email-masked]>
> 

Good cleanup.

Reviewed-by: Jacob Keller <[email-masked]>

> +void bnx2x_stop_nic(struct bnx2x *bp, int disable_hw)
> +{
> +	if (!bp->nic_stopped) {
> +		/* Disable HW interrupts, NAPI */
> +		bnx2x_netif_stop(bp, disable_hw);
> +		/* Delete all NAPI objects */
> +		bnx2x_del_all_napi(bp);
> +		if (CNIC_LOADED(bp))
> +			bnx2x_del_all_napi_cnic(bp);
> +		/* Release IRQs */
> +		bnx2x_free_irq(bp);
> +		bp->nic_stopped = true;
> +	}
> +}

IMHO this could be an early return:

if (bp->nic_stopped)
    return;

That is a bit of a nitpick and the existing code (by necessity of not
being a function) used this style.