From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72AD32E4279; Wed, 15 Oct 2025 16:16:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760544965; cv=none; b=p63ZUnu8jyowrLWkchbrfTTrQzy/vQFBy9yGi45xOqZIyMOct3aTAc0CYgDNVLdUCc50URkV2eTjjPYHQb2QVmaN/UtQQV0cePAKTqlUvmpHuDEdqFHLDsI1ivnw5tksvuE2Xrgre6EnfiJU92VYH5gNMYnb/Zi0pcGoIIuygsM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760544965; c=relaxed/simple; bh=mh2p56RFHNMS2T3Y3D/s7unv9Kw8fsakAhRbESmfhGU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XW5hNA2AC6IjxxrfmKl/yaiLIeL3c8ARnM3VDt/lY1LdedOL4MDySOHfj/buYZu8bZqqyhuCbVTZAuilrDcYIYfIIyzCTdCIWPWS24nR/GJavR4hg+rdr+9ulNcBY9opwHG0PDOmcnuDmLC6makIVFjiY5tJCVqvl0gExwoCvro= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XP5soyJs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XP5soyJs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F406EC16AAE; Wed, 15 Oct 2025 16:16:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760544965; bh=mh2p56RFHNMS2T3Y3D/s7unv9Kw8fsakAhRbESmfhGU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XP5soyJstRjA+4jh/pYRKC3icDr5UMOcRaf6fKwzZM2ixRepmPznj1Bu+MdbmFR79 y4Tmf2oOQHPGWsxnL7vXP8qh7M13XkdoQIAKjnF985BtQwh0Xxra5tD4BYwPCUH2dn uWdP0n7FcG4rrNCuc4rRdSewGNxA8Rkw8++WuRPbujdDLGeb/1CC+8zoMzRw6/gSXt 4PAdAUcqRMeciTTYjn9zo5lbApS8YoPtSKwILoCsrts7oWsSHOxhkKAK6kRgMH0V8b x5xsoetaRGUs5HDb3fe2Bx+wn8CMpq70sxHZjIVS60sYMUyIoGxbDxOrHFwd1GFgyB +ziYJVN3uSfBQ== Date: Wed, 15 Oct 2025 17:15:59 +0100 From: Simon Horman To: Harshit Mogalapalli Cc: Sunil Goutham , Linu Cherian , Geetha sowjanya , Jerin Jacob , hariprasad , Subbaraya Sundeep , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Nithya Mani , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dan.carpenter@linaro.org, kernel-janitors@vger.kernel.org, error27@gmail.com Subject: Re: [PATCH v2] Octeontx2-af: Fix pci_alloc_irq_vectors() return value check Message-ID: References: <20251015090117.1557870-1-harshit.m.mogalapalli@oracle.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251015090117.1557870-1-harshit.m.mogalapalli@oracle.com> 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 > Signed-off-by: Harshit Mogalapalli > --- > Only compile tested. > > v1->v2: Improve the commit message Thanks for the update. Reviewed-by: Simon Horman