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 CB7622F27 for ; Sun, 3 Dec 2023 11:41:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="d5lqdJZb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFCE4C433C7; Sun, 3 Dec 2023 11:41:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701603705; bh=XccCxYSOFM8R5fg3IGTtouCQNjtf99QVUi/l5Jh6WSs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d5lqdJZb4hhVJH0PsnHgitXGQdQJd18XdAvgVByoC9p5AJgHF+enWKjlVh7y2uU7v AZXqOa+wQmtIao804WE0taU2rYoHHTZTjja4tetQYA71XEmxqCb96pMVHI2w5YlsNE R9GPDbmcKEmBQ+MPI946qqEUgHLIQZATzAEHXSG25rsoC2oVbEMIQkJumvxFwGS/H9 0N85iI1IRVLc/PbOjbgjKpxGOLOrNrUao4yBRFa8TS2bhDi3wIiWCTUjkvOGbo+6nv CxAPvFYqTwSawtGbs4sajQ4G8a3NpuQqAZm2y/8UARFhFumNyG28rHNPpGJc+TvxJH /5qSMmhNR+68Q== Date: Sun, 3 Dec 2023 11:41:39 +0000 From: Simon Horman To: Ivan Vecera Cc: intel-wired-lan@lists.osuosl.org, Jesse Brandeburg , Tony Nguyen , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, Jacob Keller , Wojciech Drewek , mschmidt@redhat.com, netdev@vger.kernel.org Subject: Re: [PATCH v5 2/5] i40e: Introduce and use macros for iterating VSIs and VEBs Message-ID: <20231203114139.GG50400@kernel.org> References: <20231124150343.81520-1-ivecera@redhat.com> <20231124150343.81520-3-ivecera@redhat.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: <20231124150343.81520-3-ivecera@redhat.com> On Fri, Nov 24, 2023 at 04:03:40PM +0100, Ivan Vecera wrote: > Introduce i40e_for_each_vsi() and i40e_for_each_veb() helper > macros and use them to iterate relevant arrays. > > Replace pattern: > for (i = 0; i < pf->num_alloc_vsi; i++) > by: > i40e_for_each_vsi(pf, i, vsi) > > and pattern: > for (i = 0; i < I40E_MAX_VEB; i++) > by > i40e_for_each_veb(pf, i, veb) > > These macros also check if array item pf->vsi[i] or pf->veb[i] > are not NULL and skip such items so we can remove redundant > checks from loop bodies. > > Reviewed-by: Wojciech Drewek > Signed-off-by: Ivan Vecera Reviewed-by: Simon Horman