Subject: Re: [PATCH v2] Octeontx2-af: Fix pci_alloc_irq_vectors() return value check

From: Simon Horman <[email-masked]>
Date: Wed, 15 Oct 2025 17:15:59 +0100

On Wed, Oct 15, 2025 at 02:01:17AM -0700, Harshit Mogalapalli wrote:
> In cgx_probe() when pci_alloc_irq_vectors() fails the error value will
> be negative and that check is sufficient.
> 
> 	err = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_MSIX);
>         if (err < 0 || err != nvec) {
>         	...
> 	}
> 
> When pci_alloc_irq_vectors() fail to allocate nvec number of vectors,
> -ENOSPC is returned, so it would be safe to remove the check that
> compares err with nvec.
> 
> Fixes: 1463f382f58d ("octeontx2-af: Add support for CGX link management")
> Suggested-by: Paolo Abeni <[email-masked]>
> Signed-off-by: Harshit Mogalapalli <[email-masked]>
> ---
> Only compile tested.
> 
> v1->v2: Improve the commit message

Thanks for the update.

Reviewed-by: Simon Horman <[email-masked]>