Re: [PATCH iwl-next 5/7] i40e: Consolidate checks whether given VSI is main

From: Paolo Abeni
Date: Tue Mar 19 2024 - 06:17:40 EST


On Mon, 2024-03-18 at 15:30 +0100, Ivan Vecera wrote:
> In the driver code there are 3 types of checks whether given
> VSI is main or not:
> 1. vsi->type ==/!= I40E_VSI_MAIN
> 2. vsi ==/!= pf->vsi[pf->lan_vsi]
> 3. vsi->seid ==/!= pf->vsi[pf->lan_vsi]->seid
>
> All of them are equivalent and can be consolidated. Convert cases
> 2 and 3 to case 1.

Minor nit: while at it, what about introducing an helper for such
check?

Reordering the patches you could use it also in i40e_pf_get_main_vsi()

Cheers,

Paolo